Skip to content

Commit

Permalink
Revert "xcode: Autodetect host machine's CPU architecture"
Browse files Browse the repository at this point in the history
This reverts commit d2740cf.
  • Loading branch information
eli-schwartz committed Feb 1, 2024
1 parent 651cda4 commit 387fcf8
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions mesonbuild/backend/xcodebackend.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,6 @@ def __init__(self, build: T.Optional[build.Build], interpreter: T.Optional[Inter
self.regen_dependency_id = self.gen_id()
self.top_level_dict = PbxDict()
self.generator_outputs = {}
self.arch = self.build.environment.machines.host.cpu
if self.arch == 'aarch64':
self.arch = 'arm64'
# In Xcode files are not accessed via their file names, but rather every one of them
# gets an unique id. More precisely they get one unique id per target they are used
# in. If you generate only one id per file and use them, compilation will work but the
Expand Down Expand Up @@ -236,10 +233,11 @@ def object_filename_from_source(self, target: build.BuildTarget, source: mesonli
project = self.build.project_name
buildtype = self.buildtype
tname = target.get_id()
arch = 'x86_64'
if isinstance(source, mesonlib.File):
source = source.fname
stem = os.path.splitext(os.path.basename(source))[0]
obj_path = f'{project}.build/{buildtype}/{tname}.build/Objects-normal/{self.arch}/{stem}.o'
obj_path = f'{project}.build/{buildtype}/{tname}.build/Objects-normal/{arch}/{stem}.o'
return obj_path

def determine_swift_dep_dirs(self, target: build.BuildTarget) -> T.List[str]:
Expand Down Expand Up @@ -1393,7 +1391,7 @@ def generate_xc_build_configuration(self, objects_dict: PbxDict) -> None:
bt_dict.add_item('isa', 'XCBuildConfiguration')
settings_dict = PbxDict()
bt_dict.add_item('buildSettings', settings_dict)
settings_dict.add_item('ARCHS', f'"{self.arch}"')
settings_dict.add_item('ARCHS', '"$(NATIVE_ARCH_ACTUAL)"')
settings_dict.add_item('ONLY_ACTIVE_ARCH', 'YES')
settings_dict.add_item('SWIFT_VERSION', '5.0')
settings_dict.add_item('SDKROOT', '"macosx"')
Expand Down Expand Up @@ -1437,7 +1435,7 @@ def generate_xc_build_configuration(self, objects_dict: PbxDict) -> None:
bt_dict.add_item('isa', 'XCBuildConfiguration')
settings_dict = PbxDict()
bt_dict.add_item('buildSettings', settings_dict)
settings_dict.add_item('ARCHS', f'"{self.arch}"')
settings_dict.add_item('ARCHS', '"$(NATIVE_ARCH_ACTUAL)"')
settings_dict.add_item('ONLY_ACTIVE_ARCH', 'YES')
settings_dict.add_item('SDKROOT', '"macosx"')
settings_dict.add_item('SYMROOT', '"%s/build"' % self.environment.get_build_dir())
Expand Down

0 comments on commit 387fcf8

Please sign in to comment.