| 1 | # Standard settings |
| 2 | # set(UNIX True) |
| 3 | # set(Darwin True) |
| 4 | # set(IOS True) |
| 5 | set(CMAKE_SYSTEM_NAME Darwin) |
| 6 | set(CMAKE_SYSTEM_VERSION 1) |
| 7 | set(UNIX True) |
| 8 | set(APPLE True) |
| 9 | set(IOS True) |
| 10 | |
| 11 | # suppress -rdynamic |
| 12 | # set(CMAKE_SYSTEM_NAME Generic) |
| 13 | |
| 14 | set(CMAKE_C_COMPILER i386-apple-darwin11-clang) |
| 15 | set(CMAKE_CXX_COMPILER i386-apple-darwin11-clang++) |
| 16 | |
| 17 | set(_CMAKE_TOOLCHAIN_PREFIX i386-apple-darwin11-) |
| 18 | |
| 19 | set(CMAKE_IOS_SDK_ROOT "/home/nihui/osd/cctools-port/usage_examples/ios_toolchain/target-sim/SDK/iPhoneSimulator10.2.sdk") |
| 20 | |
| 21 | # Set the sysroot default to the most recent SDK |
| 22 | set(CMAKE_OSX_SYSROOT ${CMAKE_IOS_SDK_ROOT} CACHE PATH "Sysroot used for iOS Simulator support") |
| 23 | |
| 24 | # set the architecture for iOS |
| 25 | set(IOS_ARCH x86_64) |
| 26 | |
| 27 | set(CMAKE_OSX_ARCHITECTURES ${IOS_ARCH} CACHE STRING "Build architecture for iOS Simulator") |
| 28 | |
| 29 | if(NOT DEFINED ENABLE_BITCODE) |
| 30 | # enable bitcode support by default |
| 31 | set(ENABLE_BITCODE TRUE CACHE BOOL "enable bitcode") |
| 32 | endif() |
| 33 | |
| 34 | if(ENABLE_BITCODE) |
| 35 | # enable bitcode |
| 36 | set(CMAKE_C_FLAGS "-fembed-bitcode ${CMAKE_C_FLAGS}") |
| 37 | set(CMAKE_CXX_FLAGS "-fembed-bitcode ${CMAKE_CXX_FLAGS}") |
| 38 | endif() |
| 39 | |
| 40 | # Set the find root to the iOS developer roots and to user defined paths |
| 41 | set(CMAKE_FIND_ROOT_PATH ${CMAKE_IOS_DEVELOPER_ROOT} ${CMAKE_IOS_SDK_ROOT} ${CMAKE_PREFIX_PATH} CACHE STRING "iOS Simulator find search path root") |
| 42 | |
| 43 | # searching for frameworks only |
| 44 | set(CMAKE_FIND_FRAMEWORK FIRST) |
| 45 | |
| 46 | # set up the default search directories for frameworks |
| 47 | set(CMAKE_SYSTEM_FRAMEWORK_PATH |
| 48 | ${CMAKE_IOS_SDK_ROOT}/System/Library/Frameworks |
| 49 | ) |