aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2021-04-23 19:55:38 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2021-04-23 23:03:26 +0300
commite80a13af730867f484f017bc99059a5ddc654d4b (patch)
tree0d77dca6703ac5566eebb3b744260847aa987ab5
parent10197aa9d140211feeefeccfaae1d2a64c69d2d3 (diff)
downloadmeson-e80a13af730867f484f017bc99059a5ddc654d4b.zip
meson-e80a13af730867f484f017bc99059a5ddc654d4b.tar.gz
meson-e80a13af730867f484f017bc99059a5ddc654d4b.tar.bz2
Xcode: do not reuse objs in both_libraries because Xcode fails on targets with no sources.
-rw-r--r--mesonbuild/interpreter/interpreter.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py
index 1010494..d17d7f0 100644
--- a/mesonbuild/interpreter/interpreter.py
+++ b/mesonbuild/interpreter/interpreter.py
@@ -2732,7 +2732,18 @@ Try setting b_lundef to false instead.'''.format(self.coredata.options[OptionKey
elif key in self.environment.coredata.options:
pic = self.environment.coredata.options[key].value
- if pic:
+ if self.backend.name == 'xcode':
+ # Xcode is a bit special in that you can't (at least for the moment)
+ # form a library only from object file inputs. The simple but inefficient
+ # solution is to use the sources directly. This will lead to them being
+ # built twice. This is unfortunate and slow, but at least it works.
+ # Feel free to submit patches to get this fixed if it is an
+ # issue for you.
+ reuse_object_files = False
+ else:
+ reuse_object_files = pic
+
+ if reuse_object_files:
# Exclude sources from args and kwargs to avoid building them twice
static_args = [args[0]]
static_kwargs = kwargs.copy()