Skip to content

Commit

Permalink
Merge "Switch make and shader-tools to macOS universal builds" into s…
Browse files Browse the repository at this point in the history
…nap-temp-L87600000954196271
  • Loading branch information
Android Build Coastguard Worker authored and Gerrit Code Review committed Apr 22, 2022
2 parents 5a161a3 + a164f8e commit b4656ec
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 b4656ec

Please sign in to comment.