Coder Social home page Coder Social logo

2power10 / ios-cmake Goto Github PK

View Code? Open in Web Editor NEW

This project forked from leetal/ios-cmake

0.0 0.0 0.0 429 KB

A CMake toolchain file for iOS, watchOS and tvOS C/C++/Obj-C++ development

License: BSD 3-Clause "New" or "Revised" License

Objective-C 9.71% C++ 1.10% CMake 85.37% Objective-C++ 0.58% Shell 3.24%

ios-cmake's Introduction

A CMake toolchain file for iOS, watchOS and tvOS development with full simulator support and toggable options!

NEW!

  • The toolchain now supports the new features introduced in CMake 3.14 that allows combined (FAT libraries) to be built.
    • Please see below for the "COMBINED" options that will build a static, combined FAT library by default.
  • The IOS_PLATFORM argument have been renamed to PLATFORM to better align with how the toolchain will be used.
    • IOS_PLATFORM argument still exists, but is deprecated.
  • MUCH better support for Xcode generated project on CMake 3.14+

ios-cmake

Build Status

Tested with the following combinations:

  • XCode 5.x, iOS SDK 7
  • XCode 6.1.x, iOS SDK 8.1
  • XCode 8.2.x, iOS SDK 10.2
  • XCode 9.4.x, iOS SDK 11.4
  • XCode 10.2.x, iOS SDK 12.2

Example usage

NOTE: The below commands will build for 64-bit simulator only. Change the -DPLATFORM to the applicable value if targeting another platform.

cd example/example-lib
mkdir build
cd build
cmake .. -G Xcode -DCMAKE_TOOLCHAIN_FILE=../../ios.toolchain.cmake -DPLATFORM=OS64COMBINED
cmake --build . --config Release --target install

This will build and install the library for the given IOS_PLATFORM.

Options

  • Set -DPLATFORM to "SIMULATOR" to build for iOS simulator 32 bit (i386) DEPRECATED
  • Set -DPLATFORM to "SIMULATOR64" (example above) to build for iOS simulator 64 bit (x86_64)
  • Set -DPLATFORM to "OS" to build for Device (armv7, armv7s, arm64)
  • Set -DPLATFORM to "OS64" to build for Device (arm64)
  • Set -DPLATFORM to "OS64COMBINED" to build for Device & Simulator (FAT lib) (arm64, x86_64)
  • Set -DPLATFORM to "TVOS" to build for tvOS (arm64)
  • Set -DPLATFORM to "TVOSCOMBINED" to build for tvOS & Simulator (arm64, x86_64)
  • Set -DPLATFORM to "SIMULATOR_TVOS" to build for tvOS Simulator (x86_64)
  • Set -DPLATFORM to "WATCHOS" to build for watchOS (armv7k, arm64_32)
  • Set -DPLATFORM to "WATCHOSCOMBINED" to build for watchOS & Simulator (armv7k, arm64_32, i386)
  • Set -DPLATFORM to "SIMULATOR_WATCHOS" to build for watchOS Simulator (i386)

COMBINED options

The options called *COMBINED (OS64COMBINED, TVOSCOMBINED and WATCHOSCOMBINED) will build complete FAT-libraries for the given platform. These FAT-libraries include slices for both device and simulator, making the distribution and usage of the library much more simple!

NOTE: The COMBINED options ONLY work with the Xcode generator (-G Xcode).

Additional Options

-DENABLE_BITCODE=(BOOL) - Enabled by default, specify FALSE or 0 to disable bitcode

-DENABLE_ARC=(BOOL) - Enabled by default, specify FALSE or 0 to disable ARC

-DENABLE_VISIBILITY=(BOOL) - Disabled by default, specify TRUE or 1 to enable symbol visibility support

-DENABLE_STRICT_TRY_COMPILE=(BOOL) - Disabled by default, specify TRUE or 1 to enable strict compiler checks (will run linker on all compiler checks whenever needed)

-DARCHS=(STRING) - Valid values are: armv7, armv7s, arm64, i386, x86_64, armv7k, arm64_32. By default it will build for all valid architectures based on -DPLATFORM (see above)

To combine all platforms into the same FAT-library, either build any of the "COMBINED" platform types OR use the LIPO tool. More information on how to combine libraries with LIPO is readily available on the net.

Thanks To

Notes

Parts of the original toolchain comes from a similar project found on code.google.com

ios-cmake's People

Contributors

leetal avatar ssrobins avatar msnexploder avatar chlandsi avatar 4brunu avatar jonasvautherin avatar natbro avatar spl avatar ddovod avatar garryyan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.