aboutsummaryrefslogtreecommitdiffhomepage
path: root/CMake
diff options
context:
space:
mode:
authorHsüan <8325632+up9cloud@users.noreply.github.com>2021-12-15 16:59:21 -0800
committerAliaksei Levin <22669599+levlam@users.noreply.github.com>2021-12-17 01:10:12 +0300
commiteec1953c75785e790235ac6e9f779f241fa12898 (patch)
treea773dfd501449e90d17336ca9802edcfb1e4a4c0 /CMake
parent8d69520967b5065b99f5e514739e57e92952987c (diff)
Ability to override default value of IOS_ARCH
Diffstat (limited to 'CMake')
-rw-r--r--CMake/iOS.cmake40
1 files changed, 22 insertions, 18 deletions
diff --git a/CMake/iOS.cmake b/CMake/iOS.cmake
index 2b488c021..4c1e3065f 100644
--- a/CMake/iOS.cmake
+++ b/CMake/iOS.cmake
@@ -9,12 +9,16 @@
# OS - the default, used to build for iPhone and iPad physical devices, which have an arm arch.
# SIMULATOR - used to build for the Simulator platforms, which have an x86 arch.
#
+# IOS_ARCH = automatic(default) or "arch1;arch2" (e.q. "x86_64;arm64")
+# By default this value will be automatically chosen based on the IOS_PLATFORM value above.
+# If set manually, it will override the default and force to build those architectures only.
+#
# CMAKE_IOS_DEVELOPER_ROOT = automatic(default) or /path/to/platform/Developer folder
-# By default this location is automatcially chosen based on the IOS_PLATFORM value above.
+# By default this location is automatically chosen based on the IOS_PLATFORM value above.
# If set manually, it will override the default location and force the user of a particular Developer Platform
#
# CMAKE_IOS_SDK_ROOT = automatic(default) or /path/to/platform/Developer/SDKs/SDK folder
-# By default this location is automatcially chosen based on the CMAKE_IOS_DEVELOPER_ROOT value.
+# By default this location is automatically chosen based on the CMAKE_IOS_DEVELOPER_ROOT value.
# In this case it will always be the most up-to-date SDK found in the CMAKE_IOS_DEVELOPER_ROOT path.
# If set manually, this will force the use of a specific SDK version
@@ -191,23 +195,23 @@ set (CMAKE_IOS_SDK_ROOT ${CMAKE_IOS_SDK_ROOT} CACHE PATH "Location of the select
# Set the sysroot default to the most recent SDK
set (CMAKE_OSX_SYSROOT ${CMAKE_IOS_SDK_ROOT} CACHE PATH "Sysroot used for iOS support")
-# set the architecture for iOS
-if (IOS_PLATFORM STREQUAL "OS")
- set (IOS_ARCH "armv7;armv7s;arm64")
-elseif (IOS_PLATFORM STREQUAL "SIMULATOR")
- set (IOS_ARCH "i386;x86_64;arm64")
-elseif (IOS_PLATFORM STREQUAL "WATCHOS")
- set (IOS_ARCH "armv7k;arm64_32")
-elseif (IOS_PLATFORM STREQUAL "WATCHSIMULATOR")
- set (IOS_ARCH "i386;x86_64;arm64")
-elseif (IOS_PLATFORM STREQUAL "TVOS")
- set (IOS_ARCH "arm64")
-elseif (IOS_PLATFORM STREQUAL "TVSIMULATOR")
- set (IOS_ARCH "x86_64;arm64")
-else()
- message (WARNING "Unknown IOS_PLATFORM=<${IOS_PLATFORM}>")
+# Set the architectures unless specified manually with IOS_ARCH
+if (NOT DEFINED IOS_ARCH)
+ if (IOS_PLATFORM STREQUAL "OS")
+ set (IOS_ARCH "armv7;armv7s;arm64")
+ elseif (IOS_PLATFORM STREQUAL "SIMULATOR")
+ set (IOS_ARCH "i386;x86_64;arm64")
+ elseif (IOS_PLATFORM STREQUAL "WATCHOS")
+ set (IOS_ARCH "armv7k;arm64_32")
+ elseif (IOS_PLATFORM STREQUAL "WATCHSIMULATOR")
+ set (IOS_ARCH "i386;x86_64;arm64")
+ elseif (IOS_PLATFORM STREQUAL "TVOS")
+ set (IOS_ARCH "arm64")
+ elseif (IOS_PLATFORM STREQUAL "TVSIMULATOR")
+ set (IOS_ARCH "x86_64;arm64")
+ endif()
endif()
-message (STATUS ${IOS_ARCH})
+message (STATUS "The iOS architectures: ${IOS_ARCH}")
set (CMAKE_OSX_ARCHITECTURES ${IOS_ARCH} CACHE STRING "Build architecture for iOS")