CMake: document iOS/tvOS support in README-cmake.md
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
diff --git a/docs/README-cmake.md b/docs/README-cmake.md
index 2ce11d7..905aea2 100644
--- a/docs/README-cmake.md
+++ b/docs/README-cmake.md
@@ -15,7 +15,7 @@ platforms:
* Linux
* VS.NET 2010
* MinGW and Msys
-* OS X with support for XCode
+* macOS, iOS, and tvOS, with support for XCode
================================================================================
@@ -30,3 +30,55 @@ Assuming the source for SDL is located at ~/sdl
cmake ../sdl
This will build the static and dynamic versions of SDL in the ~/build directory.
+
+
+================================================================================
+Usage, iOS/tvOS
+================================================================================
+
+CMake 3.14+ natively includes support for iOS and tvOS. SDL binaries may be built
+using Xcode or Make, possibly among other build-systems.
+
+When using a recent version of CMake (3.14+), it should be possible to:
+
+- build SDL for iOS, both static and dynamic
+- build SDL test apps (as iOS/tvOS .app bundles)
+- generate a working SDL_config.h for iOS (using SDL_config.h.cmake as a basis)
+
+To use, set the following CMake variables when running CMake's configuration stage:
+
+- `CMAKE_SYSTEM_NAME=<OS>` (either `iOS` or `tvOS`)
+- `CMAKE_OSX_SYSROOT=<SDK>` (examples: `iphoneos`, `iphonesimulator`, `iphoneos12.4`, `/full/path/to/iPhoneOS.sdk`,
+ `appletvos`, `appletvsimulator`, `appletvos12.4`, `/full/path/to/AppleTVOS.sdk`, etc.)
+- `CMAKE_OSX_ARCHITECTURES=<semicolon-separated list of CPU architectures>` (example: "arm64;armv7s;x86_64")
+
+
+### Examples (for iOS/tvOS):
+
+- for iOS-Simulator, using the latest, installed SDK:
+
+ `cmake ~/sdl -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator -DCMAKE_OSX_ARCHITECTURES=x86_64`
+
+- for iOS-Device, using the latest, installed SDK, 64-bit only
+
+ `cmake ~/sdl -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos -DCMAKE_OSX_ARCHITECTURES=arm64`
+
+- for iOS-Device, using the latest, installed SDK, mixed 32/64 bit
+
+ `cmake ~/sdl -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos -DCMAKE_OSX_ARCHITECTURES="arm64;armv7s"`
+
+- for iOS-Device, using a specific SDK revision (iOS 12.4, in this example):
+
+ `cmake ~/sdl -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos12.4 -DCMAKE_OSX_ARCHITECTURES=arm64`
+
+- for iOS-Simulator, using the latest, installed SDK, and building SDL test apps (as .app bundles):
+
+ `cmake ~/sdl -DSDL_TEST=1 -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator -DCMAKE_OSX_ARCHITECTURES=x86_64`
+
+- for tvOS-Simulator, using the latest, installed SDK:
+
+ `cmake ~/sdl -DCMAKE_SYSTEM_NAME=tvOS -DCMAKE_OSX_SYSROOT=appletvsimulator -DCMAKE_OSX_ARCHITECTURES=x86_64`
+
+- for tvOS-Device, using the latest, installed SDK:
+
+ `cmake ~/sdl -DCMAKE_SYSTEM_NAME=tvOS -DCMAKE_OSX_SYSROOT=appletvos -DCMAKE_OSX_ARCHITECTURES=arm64`