Skip to content

Commit

Permalink
Added iOS toolchain.
Browse files Browse the repository at this point in the history
  • Loading branch information
mosra committed Feb 4, 2016
1 parent 3de9f69 commit 4948271
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
20 changes: 20 additions & 0 deletions generic/iOS.cmake
@@ -0,0 +1,20 @@
#
# Toolchain for cross-compiling to iOS using Xcode
#
# Set CMAKE_OSX_ROOT to SDK you want to target and enable all desired
# architectures in CMAKE_OSX_ARCHITECTURES. You have to addd modules/ directory
# to CMAKE_MODULE_PATH before using the toolchain file so the iOS platform file
# can be found.
#
# mkdir build-ios && cd build-ios
# cmake -DCMAKE_MODULE_PATH=/path/to/toolchains/modules/ \
# -DCMAKE_TOOLCHAIN_FILE=../toolchains/generic/iOS.cmake \
# -DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk \
# -DCMAKE_OSX_ARCHITECTURES="arm64;armv7;armv7s" -G Xcode ..
#

# We just need to name the platform differently so CMAKE_CROSSCOMPILING is set
set(CMAKE_SYSTEM_NAME "iOS")

# Required to make CMake's test_compile stuff pass
set(CMAKE_MACOSX_BUNDLE ON)
6 changes: 6 additions & 0 deletions modules/Platform/iOS.cmake
@@ -0,0 +1,6 @@
#
# Platform file for generic/iOS.cmake toolchain
#

# It's just Darwin after all
include(Platform/Darwin)

0 comments on commit 4948271

Please sign in to comment.