From 2dfd2a9b5da127151973fe69d5570fc5a6d8c689 Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Sat, 2 May 2026 22:12:37 -0700 Subject: [PATCH] Merge C++, ObjC language arguments ...in Xcode build targets. From the original author: I ran into an issue trying to compile lc0 (Leela Chess Zero engine) with Meson where a compiler option -DNO_PEXT was not being passed to clang. This was because the lc0@exe target had both cpp, objc languages and the latter language's project arguments were overriding the cpp language options. I'm assuming that since objc options are set as cpp options, the options for both languages need to be merged. After doing this, the Xcode build for lc0 succeeds. Co-authored-by: Shukant Pal Signed-off-by: Christopher Snowhill --- mesonbuild/backend/xcodebackend.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mesonbuild/backend/xcodebackend.py b/mesonbuild/backend/xcodebackend.py index bc66baf9d3ce..7c51ea548a98 100644 --- a/mesonbuild/backend/xcodebackend.py +++ b/mesonbuild/backend/xcodebackend.py @@ -1756,8 +1756,8 @@ def generate_single_build_target(self, objects_dict: PbxDict, target_name: str, lang = 'cpp' langs.add(lang) langname = LANGNAMEMAP[lang] - langargs.setdefault(langname, []) - langargs[langname] = cargs + cti_args + args + langargs.setdefault(langname, set()) + langargs[langname] |= set(cargs + cti_args + args) symroot = os.path.join(self.environment.get_build_dir(), target.subdir).rstrip('/') bt_dict = PbxDict() objects_dict.add_item(valid, bt_dict, buildtype)