CMake: document iOS/tvOS support in README-cmake.md
authorDavid Ludwig <dludwig@pobox.com>
Mon, 23 Sep 2019 18:27:14 -0400
changeset 1308776ff33e9a6b4
parent 13086 144fc4e62b72
child 13088 d55db8d27108
CMake: document iOS/tvOS support in README-cmake.md
docs/README-cmake.md
     1.1 --- a/docs/README-cmake.md	Mon Sep 23 18:24:03 2019 -0400
     1.2 +++ b/docs/README-cmake.md	Mon Sep 23 18:27:14 2019 -0400
     1.3 @@ -15,7 +15,7 @@
     1.4  * Linux
     1.5  * VS.NET 2010
     1.6  * MinGW and Msys
     1.7 -* OS X with support for XCode
     1.8 +* macOS, iOS, and tvOS, with support for XCode
     1.9  
    1.10  
    1.11  ================================================================================
    1.12 @@ -30,3 +30,55 @@
    1.13      cmake ../sdl
    1.14  
    1.15  This will build the static and dynamic versions of SDL in the ~/build directory.
    1.16 +
    1.17 +
    1.18 +================================================================================
    1.19 +Usage, iOS/tvOS
    1.20 +================================================================================
    1.21 +
    1.22 +CMake 3.14+ natively includes support for iOS and tvOS.  SDL binaries may be built
    1.23 +using Xcode or Make, possibly among other build-systems.
    1.24 +
    1.25 +When using a recent version of CMake (3.14+), it should be possible to:
    1.26 +
    1.27 +- build SDL for iOS, both static and dynamic
    1.28 +- build SDL test apps (as iOS/tvOS .app bundles)
    1.29 +- generate a working SDL_config.h for iOS (using SDL_config.h.cmake as a basis)
    1.30 +
    1.31 +To use, set the following CMake variables when running CMake's configuration stage:
    1.32 +
    1.33 +- `CMAKE_SYSTEM_NAME=<OS>`   (either `iOS` or `tvOS`)
    1.34 +- `CMAKE_OSX_SYSROOT=<SDK>`  (examples: `iphoneos`, `iphonesimulator`, `iphoneos12.4`, `/full/path/to/iPhoneOS.sdk`,
    1.35 +                              `appletvos`, `appletvsimulator`, `appletvos12.4`, `/full/path/to/AppleTVOS.sdk`, etc.)
    1.36 +- `CMAKE_OSX_ARCHITECTURES=<semicolon-separated list of CPU architectures>` (example: "arm64;armv7s;x86_64")
    1.37 +
    1.38 +
    1.39 +### Examples (for iOS/tvOS):
    1.40 +
    1.41 +- for iOS-Simulator, using the latest, installed SDK:
    1.42 +
    1.43 +    `cmake ~/sdl -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator -DCMAKE_OSX_ARCHITECTURES=x86_64`
    1.44 +
    1.45 +- for iOS-Device, using the latest, installed SDK, 64-bit only
    1.46 +
    1.47 +    `cmake ~/sdl -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos -DCMAKE_OSX_ARCHITECTURES=arm64`
    1.48 +
    1.49 +- for iOS-Device, using the latest, installed SDK, mixed 32/64 bit
    1.50 +
    1.51 +    `cmake ~/sdl -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos -DCMAKE_OSX_ARCHITECTURES="arm64;armv7s"`
    1.52 +
    1.53 +- for iOS-Device, using a specific SDK revision (iOS 12.4, in this example):
    1.54 +
    1.55 +    `cmake ~/sdl -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphoneos12.4 -DCMAKE_OSX_ARCHITECTURES=arm64`
    1.56 +
    1.57 +- for iOS-Simulator, using the latest, installed SDK, and building SDL test apps (as .app bundles):
    1.58 +
    1.59 +    `cmake ~/sdl -DSDL_TEST=1 -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=iphonesimulator -DCMAKE_OSX_ARCHITECTURES=x86_64`
    1.60 +
    1.61 +- for tvOS-Simulator, using the latest, installed SDK:
    1.62 +
    1.63 +	`cmake ~/sdl -DCMAKE_SYSTEM_NAME=tvOS -DCMAKE_OSX_SYSROOT=appletvsimulator -DCMAKE_OSX_ARCHITECTURES=x86_64`
    1.64 +
    1.65 +- for tvOS-Device, using the latest, installed SDK:
    1.66 +
    1.67 +	`cmake ~/sdl -DCMAKE_SYSTEM_NAME=tvOS -DCMAKE_OSX_SYSROOT=appletvos -DCMAKE_OSX_ARCHITECTURES=arm64`