Skip to content

Commit 0af346f

Browse files
authored
Set the iOS minimum version flag in the toolchain (#297)
* Set the iOS minimum deployment target * Update unity_ios.cmake * Update readme.md
1 parent e9f597b commit 0af346f

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

cmake/unity_ios.cmake

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,13 @@ message(STATUS "gcc found at: ${CMAKE_C_COMPILER}")
1616
message(STATUS "g++ found at: ${CMAKE_CXX_COMPILER}")
1717
message(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 "")
2026
set(CMAKE_OSX_ARCHITECTURES "arm64;armv7;x86_64;i386" CACHE STRING "")
2127
set(CMAKE_XCODE_EFFECTIVE_PLATFORMS "-iphoneos;-iphonesimulator")
2228
set(IOS_PLATFORM_LOCATION "iPhoneOS.platform;iPhoneSimulator.platform")
@@ -25,6 +31,7 @@ set(CMAKE_IOS_INSTALL_UNIVERSAL_LIBS "YES")
2531
set(CMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH "NO")
2632
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED "NO")
2733
set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE "YES")
34+
set(CMAKE_OSX_DEPLOYMENT_TARGET "8.0" CACHE STRING "")
2835

2936
# skip TRY_COMPILE checks
3037
set(CMAKE_CXX_COMPILER_WORKS TRUE)

docs/readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ Release Notes
160160
- General: Minimum supported editor version is now Unity 2018.
161161
- General (Editor, macOS): Add support for Apple Silicon chips.
162162
- General (iOS): Firebase Unity on iOS is now built using Xcode 13.3.1.
163+
- General (iOS): Fixed crash when running on iPhoneOS 12 and older.
163164
- Analytics: Removed deprecated event names and parameters.
164165
- Crashlytics (Android): Fixed a bug with missing symbols when enabling
165166
minification via proguard.

0 commit comments

Comments
 (0)