1- A CMake toolchain file for iOS, watchOS and tvOS development with full simulator support and toggable options!
1+ A CMake toolchain file for iOS (+ Catalyst) , watchOS, tvOS and macOS development with full simulator support and toggleable options!
22
33### NEW!
4- * Now exposes Autoconf compatible triples, accessible via the ` APPLE_TARGET_TRIPLE ` variable.
4+ * Experimental Catalyst support (iOS on macOS)
5+ * macOS support and experimental Apple Silicon support
6+ * Deprecated options now removed.
57
68ios-cmake
79=========
@@ -14,42 +16,55 @@ Tested with the following combinations:
1416* XCode 10.2, iOS SDK 12.2
1517* XCode 11.1, iOS SDK 13.1
1618* XCode 11.3, iOS SDK 13.3
17- * XCode 12.2, iOS SDK 14.2
19+ * XCode 12.4, iOS/iPadOS SDK 14.4, tvOS 14.3, watchOS 7.2, macOS SDK 11.1
20+
21+ ## Platform flag options (-DPLATFORM=_ flag_ )
22+
23+ * _ OS_ - to build for iOS (armv7, armv7s, arm64) ** DEPRECATED in favour of OS64**
24+ * _ OS64_ - to build for iOS (arm64 only)
25+ * _ OS64COMBINED_ - to build for iOS & iOS Simulator (FAT lib) (arm64, x86_64)
26+ * _ SIMULATOR_ - to build for iOS simulator 32 bit (i386) ** DEPRECATED**
27+ * _ SIMULATOR64_ - to build for iOS simulator 64 bit (x86_64)
28+ * _ SIMULATORARM64_ - to build for iOS simulator 64 bit (arm64)
29+ * _ TVOS_ - to build for tvOS (arm64)
30+ * _ TVOSCOMBINED_ - to build for tvOS & tvOS Simulator (arm64, x86_64)
31+ * _ SIMULATOR_TVOS_ - to build for tvOS Simulator (x86_64)
32+ * _ WATCHOS_ - to build for watchOS (armv7k, arm64_32)
33+ * _ WATCHOSCOMBINED_ - to build for watchOS & Simulator (armv7k, arm64_32, i386)
34+ * _ SIMULATOR_WATCHOS_ - to build for watchOS Simulator (i386)
35+ * _ MAC_ - to build for macOS (x86_64)
36+ * _ MAC_ARM64_ - to build for macOS on Apple Silicon (arm64)
37+ * _ MAC_CATALYST_ - to build iOS for Mac (Catalyst, x86_64)
38+ * _ MAC_CATALYST_ARM64_ - to build iOS for Mac on Apple Silicon (Catalyst, arm64)
1839
1940# Example usage
20- ** NOTE: The below commands will build for 64-bit simulator only. Change the ` -DPLATFORM ` to the applicable value if targeting another platform.**
41+ ** _ NOTE _ : Change the ` -DPLATFORM ` to an applicable value if targeting another platform.**
2142
2243``` bash
2344cd example/example-lib
2445mkdir build
2546cd build
26- cmake .. -G Xcode -DCMAKE_TOOLCHAIN_FILE=../../ios.toolchain.cmake -DPLATFORM=OS64COMBINED
27- cmake --build . --config Release --target install
47+ cmake .. -G Xcode -DCMAKE_TOOLCHAIN_FILE=../../ios.toolchain.cmake -DPLATFORM=OS64
48+ cmake --build . --config Release
2849```
2950
30- This will build and install the library for the given IOS_PLATFORM.
31-
32- ## Options
33-
34- * Set ` -DPLATFORM ` to "SIMULATOR" to build for iOS simulator 32 bit (i386) ** DEPRECATED**
35- * Set ` -DPLATFORM ` to "SIMULATOR64" (example above) to build for iOS simulator 64 bit (x86_64)
36- * Set ` -DPLATFORM ` to "SIMULATORARM64" to build for iOS simulator 64 bit (arm64)
37- * Set ` -DPLATFORM ` to "OS" to build for Device (armv7, armv7s, arm64)
38- * Set ` -DPLATFORM ` to "OS64" to build for Device (arm64)
39- * Set ` -DPLATFORM ` to "OS64COMBINED" to build for Device & Simulator (FAT lib) (arm64, x86_64)
40- * Set ` -DPLATFORM ` to "TVOS" to build for tvOS (arm64)
41- * Set ` -DPLATFORM ` to "TVOSCOMBINED" to build for tvOS & Simulator (arm64, x86_64)
42- * Set ` -DPLATFORM ` to "SIMULATOR_TVOS" to build for tvOS Simulator (x86_64)
43- * Set ` -DPLATFORM ` to "WATCHOS" to build for watchOS (armv7k, arm64_32)
44- * Set ` -DPLATFORM ` to "WATCHOSCOMBINED" to build for watchOS & Simulator (armv7k, arm64_32, i386)
45- * Set ` -DPLATFORM ` to "SIMULATOR_WATCHOS" to build for watchOS Simulator (i386)
51+ This will build and install the library for the given PLATFORM. In this case, iOS with the arm64 architecture.
4652
4753### COMBINED Options
4854The options called * COMBINED (OS64COMBINED, TVOSCOMBINED and WATCHOSCOMBINED) will build complete FAT-libraries for
4955the given platform. These FAT-libraries include slices for both device and simulator, making the distribution and
5056usage of the library much more simple!
5157
52- ** NOTE: The COMBINED options _ ONLY_ work with the Xcode generator (-G Xcode), together with a install-target (see example above).**
58+ Example:
59+ ``` bash
60+ cmake . -G Xcode -DCMAKE_TOOLCHAIN_FILE=../../ios.toolchain.cmake -DPLATFORM=OS64COMBINED
61+ cmake --build . --config Release
62+ cmake --install . --config Release
63+ ```
64+
65+ ** _ NOTE_ : The COMBINED options _ ONLY_ work with the Xcode generator (-G Xcode) on CMake versions 3.14+!**
66+
67+ ---
5368
5469### Exposed Variables
5570` XCODE_VERSION ` - Version number (not including Build version) of Xcode detected.
@@ -78,8 +93,4 @@ LIPO tool. More information on how to combine libraries with LIPO is readily ava
7893
7994* [ natbro] ( https://github.com/natbro ) for adding tvOS support
8095* [ MSNexploder] ( https://github.com/MSNexploder ) for adding OS64 and arm64e support
81- * [ garryyan] ( https://github.com/garryyan ) for adding watchOS support
82-
83- ## Notes
84-
85- Parts of the original toolchain comes from a similar project found on code.google.com
96+ * [ garryyan] ( https://github.com/garryyan ) for adding watchOS support
0 commit comments