@@ -26,6 +26,9 @@ if(APPLE)
26
26
# iOS build options
27
27
option (BUILD_IOS "Build for iOS" NO )
28
28
option (FORCE_RESET_OSX_DEPLOYMENT_TARGET "Clear the OSX Deployment Target Set" YES )
29
+ if (DEFINED FORCE_RESET_DEPLOYMENT_TARGET)
30
+ set (FORCE_RESET_OSX_DEPLOYMENT_TARGET ${FORCE_RESET_DEPLOYMENT_TARGET} )
31
+ endif ()
29
32
30
33
if (BUILD_IOS)
31
34
set (TARGET_ARCH "APPLE" )
@@ -34,14 +37,14 @@ if(APPLE)
34
37
35
38
if (FORCE_RESET_OSX_DEPLOYMENT_TARGET)
36
39
set (CMAKE_OSX_DEPLOYMENT_TARGET "" CACHE STRING "Force unset of the deployment target for iOS" FORCE)
37
- endif ()
38
-
39
- if (( ${IOS_PLAT} STREQUAL "iphonesimulator" ) AND ( ${IOS_ARCH} STREQUAL " arm64" ))
40
- # iOS arm64 simulator is supported starting BigSur
41
- # Unfortunately, CMAKE produces a device binary (not simulator) when providing -miphoneos-version-min flag when building iOS arm64 simulator
42
- else ( )
43
- set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS } -miphoneos-version-min=${IOS_DEPLOYMENT_TARGET} " )
44
- set ( CMAKE_CXX_FLAGS " ${CMAKE_CXX_FLAGS} -miphoneos-version-min= ${IOS_DEPLOYMENT_TARGET} " )
40
+
41
+ if (( ${IOS_PLAT} STREQUAL "iphonesimulator" ) AND (( ${IOS_ARCH} STREQUAL "arm64" ) OR ( ${IOS_ARCH} STREQUAL "arm64e" )))
42
+ # iOS arm64 simulator is supported starting BigSur
43
+ # Unfortunately, CMAKE produces a device binary (not simulator) when providing -miphoneos-version-min flag when building iOS arm64 simulator
44
+ else ()
45
+ set (CMAKE_C_FLAGS " ${CMAKE_C_FLAGS} -miphoneos-version-min= ${IOS_DEPLOYMENT_TARGET} " )
46
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS } -miphoneos-version-min=${IOS_DEPLOYMENT_TARGET} " )
47
+ endif ( )
45
48
endif ()
46
49
47
50
if ((${IOS_PLAT} STREQUAL "iphoneos" ) OR (${IOS_PLAT} STREQUAL "iphonesimulator" ))
@@ -54,12 +57,12 @@ if(APPLE)
54
57
set (IOS_PLATFORM "iphonesimulator" )
55
58
set (CMAKE_SYSTEM_PROCESSOR x86_64)
56
59
elseif (${IOS_ARCH} STREQUAL "arm64" )
57
- set (IOS_PLATFORM "iphoneos" )
60
+ set (IOS_PLATFORM ${IOS_PLAT} )
58
61
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -arch arm64" )
59
62
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -arch arm64" )
60
63
set (CMAKE_SYSTEM_PROCESSOR arm64)
61
64
elseif (${IOS_ARCH} STREQUAL "arm64e" )
62
- set (IOS_PLATFORM "iphoneos" )
65
+ set (IOS_PLATFORM ${IOS_PLAT} )
63
66
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -arch arm64e" )
64
67
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -arch arm64e" )
65
68
set (CMAKE_SYSTEM_PROCESSOR arm64e)
0 commit comments