Skip to content

Commit

Permalink
Switch make and shader-tools to macOS universal builds
Browse files Browse the repository at this point in the history
Test: checkbuild.py on macOS Big Sur with Xcode 12.5.1
Bug: android/ndk#1546
Bug: android/ndk#1577
Change-Id: I09e477c50c8e3eb927dc3a713278d290c5c213e5
  • Loading branch information
rprichard committed Sep 2, 2021
1 parent d5a5e29 commit f9cbfd2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ndk/cmake.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
}
Expand Down Expand Up @@ -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),
Expand All @@ -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:
Expand Down

0 comments on commit f9cbfd2

Please sign in to comment.