From f9cbfd21271d8eec72d6ff92dfd93d9ad80a13fc Mon Sep 17 00:00:00 2001 From: Ryan Prichard Date: Thu, 2 Sep 2021 01:23:15 -0700 Subject: [PATCH] Switch make and shader-tools to macOS universal builds Test: checkbuild.py on macOS Big Sur with Xcode 12.5.1 Bug: https://github.com/android/ndk/issues/1546 Bug: https://github.com/android/ndk/issues/1577 Change-Id: I09e477c50c8e3eb927dc3a713278d290c5c213e5 --- ndk/cmake.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ndk/cmake.py b/ndk/cmake.py index 7290de9f3..ef57d4078 100644 --- a/ndk/cmake.py +++ b/ndk/cmake.py @@ -35,7 +35,6 @@ } HOST_TRIPLE_MAP = { - Host.Darwin: 'x86_64-apple-darwin', Host.Linux: 'x86_64-linux-gnu', Host.Windows64: 'x86_64-w64-mingw32', } @@ -153,9 +152,7 @@ def cmake_defines(self) -> Dict[str, str]: ldflags = ' '.join(self.ldflags) defines: Dict[str, str] = { 'CMAKE_C_COMPILER': str(self.toolchain.cc), - 'CMAKE_C_COMPILER_TARGET': HOST_TRIPLE_MAP[self.host], 'CMAKE_CXX_COMPILER': str(self.toolchain.cxx), - 'CMAKE_CXX_COMPILER_TARGET': HOST_TRIPLE_MAP[self.host], 'CMAKE_AR': str(self.toolchain.ar), 'CMAKE_RANLIB': str(self.toolchain.ranlib), 'CMAKE_NM': str(self.toolchain.nm), @@ -179,6 +176,11 @@ def cmake_defines(self) -> Dict[str, str]: } if self.host.is_windows: defines['CMAKE_RC'] = str(self.toolchain.rescomp) + if self.host == Host.Darwin: + defines['CMAKE_OSX_ARCHITECTURES'] = 'x86_64;arm64' + else: + defines['CMAKE_C_COMPILER_TARGET'] = HOST_TRIPLE_MAP[self.host] + defines['CMAKE_CXX_COMPILER_TARGET'] = HOST_TRIPLE_MAP[self.host] return defines def clean(self) -> None: