@@ -16,7 +16,13 @@ message(STATUS "gcc found at: ${CMAKE_C_COMPILER}")
1616message (STATUS "g++ found at: ${CMAKE_CXX_COMPILER} " )
1717message (STATUS "Using iOS SDK: ${CMAKE_OSX_SYSROOT} " )
1818
19- set (CMAKE_OSX_SYSROOT "iphoneos;iphonesimulator" )
19+ set (CMAKE_SYSTEM_NAME "iOS" )
20+ # In order to build for both device and simulator, this needs to be empty,
21+ # or the CMAKE_OSX_DEPLOYMENT_TARGET setting below is not handled correctly.
22+ # Note, this seems to cause an issue with repeating builds on some cmake versions,
23+ # the long term fix will likely be to not handle both device and simulator with
24+ # the same toolchain, and instead merge the libraries after the fact.
25+ set (CMAKE_OSX_SYSROOT "" )
2026set (CMAKE_OSX_ARCHITECTURES "arm64;armv7;x86_64;i386" CACHE STRING "" )
2127set (CMAKE_XCODE_EFFECTIVE_PLATFORMS "-iphoneos;-iphonesimulator" )
2228set (IOS_PLATFORM_LOCATION "iPhoneOS.platform;iPhoneSimulator.platform" )
@@ -25,6 +31,7 @@ set(CMAKE_IOS_INSTALL_UNIVERSAL_LIBS "YES")
2531set (CMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH "NO" )
2632set (CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO" )
2733set (CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "YES" )
34+ set (CMAKE_OSX_DEPLOYMENT_TARGET "8.0" CACHE STRING "" )
2835
2936# skip TRY_COMPILE checks
3037set (CMAKE_CXX_COMPILER_WORKS TRUE )
0 commit comments