Giter Site home page Giter Site logo

pasberka / 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 487 KB

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

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

C++ 1.55% Objective-C 6.20% Objective-C++ 0.33% CMake 91.92%

ios-cmake's Introduction

A CMake toolchain file for iOS (+ Catalyst), watchOS, tvOS and macOS development with full simulator support and toggleable options!

ios-cmake

catalyst-jobs   combined-jobs   ios-jobs

macos-jobs   tvos-jobs   watchos-jobs

Platform flag options (-DPLATFORM=flag)

  • OS - to build for iOS (armv7, armv7s, arm64) DEPRECATED in favour of OS64
  • OS64 - to build for iOS (arm64 only)
  • OS64COMBINED - to build for iOS & iOS Simulator (FAT lib) (arm64, x86_64)
  • SIMULATOR - to build for iOS simulator 32 bit (i386) DEPRECATED
  • SIMULATOR64 - to build for iOS simulator 64 bit (x86_64)
  • SIMULATORARM64 - to build for iOS simulator 64 bit (arm64)
  • TVOS - to build for tvOS (arm64)
  • TVOSCOMBINED - to build for tvOS & tvOS Simulator (arm64, x86_64)
  • SIMULATOR_TVOS - to build for tvOS Simulator (x86_64)
  • SIMULATORARM64_TVOS = to build for tvOS Simulator (arm64)
  • WATCHOS - to build for watchOS (armv7k, arm64_32)
  • WATCHOSCOMBINED - to build for watchOS & Simulator (armv7k, arm64_32, i386)
  • SIMULATOR_WATCHOS - to build for watchOS Simulator (i386)
  • SIMULATORARM64_WATCHOS = to build for watchOS Simulator (arm64)
  • MAC - to build for macOS (x86_64)
  • MAC_ARM64 - to build for macOS on Apple Silicon (arm64)
  • MAC_UNIVERSAL - to build for macOS on x86_64 and Apple Silicon (arm64) combined
  • MAC_CATALYST - to build iOS for Mac (Catalyst, x86_64)
  • MAC_CATALYST_ARM64 - to build iOS for Mac on Apple Silicon (Catalyst, arm64)

Example usage

NOTE: Change the -DPLATFORM to an applicable value if targeting another platform.

cd example/example-lib
cmake -B build -G Xcode -DCMAKE_TOOLCHAIN_FILE=../../ios.toolchain.cmake -DPLATFORM=OS64
cmake --build build --config Release

This will build the library for the given PLATFORM. In this case, iOS with the arm64 architecture.

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!

Example:

cmake . -G Xcode -DCMAKE_TOOLCHAIN_FILE=../../ios.toolchain.cmake -DPLATFORM=OS64COMBINED
cmake --build . --config Release
cmake --install . --config Release # Necessary to build combined library

NOTE: The COMBINED options ONLY work with the Xcode generator (-G Xcode) on CMake versions 3.14+!


Exposed Variables

XCODE_VERSION - Version number (not including Build version) of Xcode detected.

SDK_VERSION - Version of SDK being used.

CMAKE_OSX_ARCHITECTURES - Architectures being compiled for (generated from PLATFORM).

APPLE_TARGET_TRIPLE - Used by autoconf build systems.

Additional Options

-DENABLE_BITCODE=(BOOL) - Disabled by default, specify TRUE or 1 to enable 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

ios-cmake's People

Contributors

leetal avatar ssrobins avatar 3d4m-volodymyr avatar jhakulin avatar msnexploder avatar simplydanny avatar jonasvautherin avatar scivision avatar chlandsi avatar yudrb avatar spl avatar dctrnoob avatar kosyak avatar a4z avatar caobug avatar ddovod avatar neusoft-technology-solutions avatar garryyan avatar luncliff avatar ericoporto avatar natbro avatar greenrobot avatar lalomartins avatar kemchenj avatar georgemp avatar floriandenis avatar blackclaws avatar ealeksandrov avatar daydreamcoding avatar 4brunu 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.