Closed wangkuiyi closed 1 year ago
@malfet anything else we need to check besides CI? (unfamiliar with cpuinfo lib)
@wconstab @malfet - I verified that the change works on macOS M2 cross-compiling for macOS, iOS, iOS simulator, tvOS, and tvOS simulator with x86_64, arm64, and arm64e (M2).
I do not have macOS-x86_64, Linux, Windows, or Android. So I will have to rely on CI for these platforms.
Ok, Windows and linter failures does not happen on trunk, so looks like this change is doing something unexpected, looking...
Well, SET
command only take literals in Cmake, isn't it, and MATCHES
binary tests can only be used in IF()
condition.
I realized that we need this when I was building the OpenXLA/IREE runtime for tvOS and watchOS.
Before this change, the
CMakeLists.txt
file uses CMake built-in variableIOS
, which is equivalent toCMAKE_SYSTEM_NAME STREQUAL "iOS"
, to tell if it is building for Apple mobile platforms. This trick prevents CMake from recognizing tvOS and watchOS.This pull requests changes the use of
IOS
intoset(APPLE_SYSTEM CMAKE_SYSTEM_NAME MATCHES "^(Darwin|iOS|tvOS|watchOS)")
.Before this change, the
CMakeLists.txt
assumes that Apple's ARM64 platform has the name "arm64". However, M2 chip has the name "arm64e". This pull request changesMATCHES "arm64"
intoMATCHES "arm64.*"
.