summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick <0xb000@gmail.com>2024-11-26 12:16:59 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2024-12-06 16:14:04 +0200
commitf8ade622c635bc2516bf45cb8028404e1d0b83d8 (patch)
treedcca4f86d86d1105df4223f5a5a04f78d9674920
parent0efc33940417ed3ca80addf702fb7549eef99b69 (diff)
downloadmeson-f8ade622c635bc2516bf45cb8028404e1d0b83d8.tar.gz
Slightly fix compiler args order for the Xcode backend
Reorder compile args so that target has a chance to override options set by its dependencies. Fix piling up of custom target include paths.
-rw-r--r--mesonbuild/backend/xcodebackend.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/mesonbuild/backend/xcodebackend.py b/mesonbuild/backend/xcodebackend.py
index 31fd272b3..55a8b9968 100644
--- a/mesonbuild/backend/xcodebackend.py
+++ b/mesonbuild/backend/xcodebackend.py
@@ -1703,12 +1703,12 @@ class XCodeBackend(backends.Backend):
for d in swift_dep_dirs:
args += compiler.get_include_args(d, False)
if args:
- lang_cargs = cargs
+ cti_args = []
if compiler and target.implicit_include_directories:
# It is unclear what is the cwd when xcode runs. -I. does not seem to
# add the root build dir to the search path. So add an absolute path instead.
# This may break reproducible builds, in which case patches are welcome.
- lang_cargs += self.get_custom_target_dir_include_args(target, compiler, absolute_path=True)
+ cti_args = self.get_custom_target_dir_include_args(target, compiler, absolute_path=True)
# Xcode cannot handle separate compilation flags for C and ObjectiveC. They are both
# put in OTHER_CFLAGS. Same with C++ and ObjectiveC++.
if lang == 'objc':
@@ -1716,11 +1716,8 @@ class XCodeBackend(backends.Backend):
elif lang == 'objcpp':
lang = 'cpp'
langname = LANGNAMEMAP[lang]
- if langname in langargs:
- langargs[langname] += args
- else:
- langargs[langname] = args
- langargs[langname] += lang_cargs
+ langargs.setdefault(langname, [])
+ langargs[langname] = cargs + cti_args + args
symroot = os.path.join(self.environment.get_build_dir(), target.subdir)
bt_dict = PbxDict()
objects_dict.add_item(valid, bt_dict, buildtype)