Skip to content

Commit 12e0818

Browse files
committed
Set explicitly the desired Darwin architecture for all CMake builds
This would be needed to compile on Apple Silicon, so that CMake does not infer the wrong architecture when we want to build for Intel (see https://gitlab.kitware.com/cmake/cmake/-/merge_requests/5291) Addresses rdar://99587478
1 parent 436598f commit 12e0818

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Utilities/build-script-helper.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,7 @@ def build_using_cmake(args, toolchain_bin, build_dir, targets):
425425
swift_flags.append('-target %s' % target)
426426
if platform.system() == 'Darwin':
427427
base_cmake_flags.append('-DCMAKE_OSX_DEPLOYMENT_TARGET=%s' % macos_deployment_target)
428+
base_cmake_flags.append('-DCMAKE_OSX_ARCHITECTURES=%s' % target.split('-')[0])
428429

429430
# Target directory for build artifacts
430431
# If building for a local compiler build, use the build directory directly
@@ -469,8 +470,6 @@ def build_llbuild_using_cmake(args, target, swiftc_exec, build_dir, base_cmake_f
469470
'-DCMAKE_CXX_FLAGS=-target %s' % target,
470471
'-DLLBUILD_SUPPORT_BINDINGS:=Swift'
471472
]
472-
if platform.system() == 'Darwin':
473-
flags.append('-DCMAKE_OSX_ARCHITECTURES=%s' % target.split('-')[0])
474473
llbuild_cmake_flags = base_cmake_flags + flags
475474
if args.sysroot:
476475
llbuild_cmake_flags.append('-DSQLite3_INCLUDE_DIR=%s/usr/include' % args.sysroot)

0 commit comments

Comments
 (0)