From da20ea01ca257987216b0798966070fecc40bfc9 Mon Sep 17 00:00:00 2001 From: Albert Tang Date: Fri, 22 Sep 2023 09:53:18 -0500 Subject: [PATCH] xcode: Generate files for highest detected version Some settings require "objectVersion" to be set to a certain value or Xcode will not use it. To fix this, we set it to the highest possible value, determined by the detected version of Xcode. We also set "compatibilityVersion", but mainly so it lines up with "objectVersion". At the same time, we should not be generating Xcode 3.2-compatible projects by default anyway. --- 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 629a22257..f1b5c5172 100644 --- a/mesonbuild/backend/xcodebackend.py +++ b/mesonbuild/backend/xcodebackend.py @@ -1271,7 +1271,7 @@ class XCodeBackend(backends.Backend): project_dict.add_item('buildStyles', style_arr) for name, idval in self.buildstylemap.items(): style_arr.add_item(idval, name) - project_dict.add_item('compatibilityVersion', '"Xcode 3.2"') + project_dict.add_item('compatibilityVersion', f'"{self.xcodeversion}"') project_dict.add_item('hasScannedForEncodings', 0) project_dict.add_item('mainGroup', self.maingroup_id) project_dict.add_item('projectDirPath', '"' + self.environment.get_source_dir() + '"') @@ -1870,7 +1870,7 @@ class XCodeBackend(backends.Backend): def generate_prefix(self, pbxdict: PbxDict) -> PbxDict: pbxdict.add_item('archiveVersion', '1') pbxdict.add_item('classes', PbxDict()) - pbxdict.add_item('objectVersion', '46') + pbxdict.add_item('objectVersion', self.objversion) objects_dict = PbxDict() pbxdict.add_item('objects', objects_dict)