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

Overview

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

NEW!

  • Experimental Catalyst support (iOS on macOS)
  • macOS support and experimental Apple Silicon support
  • Deprecated options now removed.

ios-cmake

Build Status

Tested with the following combinations:

  • XCode 8.3, iOS SDK 10.3
  • XCode 9.4, iOS SDK 11.4
  • XCode 10.2, iOS SDK 12.2
  • XCode 11.1, iOS SDK 13.1
  • XCode 11.3, iOS SDK 13.3
  • XCode 12.4, iOS/iPadOS SDK 14.4, tvOS 14.3, watchOS 7.2, macOS SDK 11.1

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)
  • 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)
  • MAC - to build for macOS (x86_64)
  • MAC_ARM64 - to build for macOS on Apple Silicon (arm64)
  • 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
mkdir build
cd build
cmake .. -G Xcode -DCMAKE_TOOLCHAIN_FILE=../../ios.toolchain.cmake -DPLATFORM=OS64
cmake --build . --config Release

This will build and install 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

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) - 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

Issues
  • Add Catalyst support (UIKit on macOS)

    Add Catalyst support (UIKit on macOS)

    This seems possible via -target x86_64-apple-ios-macabi -miphoneos-version-min=13.0. Adding it to CFLAGS and LDFLAGS should be sufficient, although untested.

    enhancement 
    opened by leetal 11
  • Invalid iOS deployment version

    Invalid iOS deployment version

    Hi, I tried to get your iOS CMake Toolchain running but I always get the same error:

    clang: error: invalid iOS deployment version '-mios-simulator-version-min=12.1',
    iOS 10 is the maximum deployment target for 32-bit targets
    [-Winvalid-ios-deployment-target]
    

    I know 32-bit targets are no longer supported, but I don't understand why the CMake build always sets this target (i.e. i386). No matter if I set IOS_PLATFORM macro to OS or SIMULATOR64.

    I also tried different deployment targets: 8.0, 10.0, 12.0, and 12.1. But since SDK 12.1 is my only installed SDK, the CMake build can only use this one.

    Can anyone tell me what I'm doing wrong?

    bug 
    opened by LukasBanana 10
  • cmake error

    cmake error

    there is an error occur when i build the google test and avs-device-sdk

    I enter the command on the command line: cmake ../googletest -DIOS_DEPLOYMENT_TARGET=10.0 -DCMAKE_TOOLCHAIN_FILE=../ios-cmake/ios.toolchain.cmake -DIOS_PLATFORM=OS or cmake ../avs-device-sdk -DIOS_DEPLOYMENT_TARGET=10.0 -DCMAKE_TOOLCHAIN_FILE=../ios-cmake/ios.toolchain.cmake -DIOS_PLATFORM=OS -DGSTREAMER_MEDIA_PLAYER=OFF -DCURL_LIBRARY=../Build-OpenSSL-cURL/archive/libcurl-7.54.1-openssl-1.0.2l-nghttp2-1.24.0/libcurl_iOS.a -DCURL_INCLUDE_DIR=../Build-OpenSSL-cURL/curl/curl-7.55.1/include -DGTEST_LIBRARY=../googletest_build/googlemock/libgmock.a -DGTEST_MAIN_LIBRARY=../googletest_build/googlemock/libgmock_main.a -DGTEST_INCLUDE_DIR=../googletest/googletest/include/ -DPKG_CONFIG_EXECUTABLE=/usr/local/bin/pkg-config

    error is:

    -- Building with Xcode version: -- Configuring iOS build for platform: SIMULATOR64, architecture(s): x86_64 -- Using SDK: for platform: SIMULATOR64 CMake Error at ../ios-cmake/ios.toolchain.cmake:172 (message): Invalid CMAKE_OSX_SYSROOT: does not exist. Call Stack (most recent call first): /usr/local/Cellar/cmake/3.11.3/share/cmake/Modules/CMakeDetermineSystem.cmake:94 (include) CMakeLists.txt:4 (project)

    CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool. CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage -- Configuring incomplete, errors occurred!

    How can I build it successfully?

    opened by wanJunGe 10
  • CMake fails to find XCTest (3.0.1 release)

    CMake fails to find XCTest (3.0.1 release)

    Hello,

    I tried the recent 3.0.1 update, and encountered an issue I can't fix.

    For some part of my code, I use CMake to create XCTest targets with your toolchain using XCode generator. For this, I add find_package(XCTest REQUIRED) in my CMakeLists, and use the functions xctest_add_bundle and xctest_add_test to generator my XCTest targets.

    Everything worked fine, but when I updated the toolchain from 2.2.0 to the 3.0.1 and changed IOS_PLATFORM to PLATFORM in my Cmake build scrits, I obtained the following error :

    CMake Error at /usr/local/Cellar/cmake/3.14.1/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
      Could NOT find XCTest (missing: XCTest_LIBRARY XCTest_INCLUDE_DIR)
    Call Stack (most recent call first):
      /usr/local/Cellar/cmake/3.14.1/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
      /usr/local/Cellar/cmake/3.14.1/share/cmake/Modules/FindXCTest.cmake:84 (find_package_handle_standard_args)
      MWMAudioKit/MWMAudioKit_Core/CoreMathVector-Tests/CMakeLists.txt:30 (find_package)
    

    I'm running CMake 3.14.1 and I have XCode 10.2 with iOS SDK 12.2 installed.

    I looked at the diff of your release and tried a few things but couldn't find any solution. Any idea of something I or you did wrong ?

    Thanks again for your work :)

    Tom

    bug upstream fix needed 
    opened by ThomasHezard 9
  • Use CMAKE_IOS_INSTALL_COMBINED CMake Variable for Universal Library Support Out-of-the-Box

    Use CMAKE_IOS_INSTALL_COMBINED CMake Variable for Universal Library Support Out-of-the-Box

    Since CMake 3.5.2, it seems CMake has support for Universal fat libraries out-of-the-box. This can be set with CMAKE_IOS_INSTALL_COMBINED.

    From the official documentation for the target property IOS_INSTALL_COMBINED:

    When this property is set to set to false (which is the default) then it will either be built with the device SDK or the simulator SDK depending on the SDK set. But if this property is set to true then the target will at install time also be built for the corresponding SDK and combined into one library.

    This feature requires at least Xcode version 6.

    Internally, it seems to create an install task on the target to build for all the supplied Apple Device SDKs then combine all the binaries into 1 fat binary using lipo.

    I haven't actually started using this variable yet, and I'm not exactly sure how it would even fit with the current toolchain, but if I can figure it out before someone else investigates it, I'm willing to create a pull request.

    enhancement 
    opened by epicstar 9
  • Recent addition of CMAKE_SYSTEM_PROCESSOR breaks some build

    Recent addition of CMAKE_SYSTEM_PROCESSOR breaks some build

    It seems to me that the recent addition (solving #40) of CMAKE_SYSTEM_PROCESSOR breaks some build.

    I am not sure why, so here is a reproducible example:

    1. Use the latest ios.toolchain.cmake file
    2. Use the following CMakeLists.txt, which will basically download and build libressl
    3. Run cmake -DCMAKE_TOOLCHAIN_FILE=/path/to/ios.toolchain.cmake ..

    CMakeLists.txt

    cmake_minimum_required(VERSION 3.1)
      
    project(external-libressl)
    include(ExternalProject)
    
    set(LIBRESSL_VERSION 2.9.0)
    
    list(APPEND CMAKE_ARGS
        "-DCMAKE_TOOLCHAIN_FILE:PATH=${CMAKE_TOOLCHAIN_FILE}"
        "-DBUILD_SHARED_LIBS=OFF"
        "-DLIBRESSL_APPS=OFF"
        "-DLIBRESSL_TESTS=OFF"
        )
    
    if(IOS)
        list(APPEND CMAKE_ARGS
            "-DPLATFORM=${PLATFORM}"
            "-DCMAKE_C_FLAGS=-Wno-implicit-function-declaration"
            )
    endif()
    
    message(STATUS "Preparing external project \"libressl\" with args:")
    foreach(CMAKE_ARG ${CMAKE_ARGS})
        message(STATUS "-- ${CMAKE_ARG}")
    endforeach()
    
    ExternalProject_add(
        libressl
        URL https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-${LIBRESSL_VERSION}.tar.gz
        PREFIX libressl
        CMAKE_ARGS "${CMAKE_ARGS}"
        )
    

    The error I get:

    [ 75%] Performing build step for 'libressl'
    Scanning dependencies of target crypto
    [  0%] Building C object crypto/CMakeFiles/crypto.dir/aes/aes-elf-armv4.S.o
    /tmp/demo_libressl/build/libressl/src/libressl/crypto/aes/aes-elf-armv4.S:1:10: fatal error: 'arm_arch.h' file not found
    #include "arm_arch.h"
             ^~~~~~~~~~~~
    

    Removing this addition of CMAKE_SYSTEM_PROCESSOR fixes it, I have no idea why.

    opened by JonasVautherin 8
  • Need an option to build OS64 libraries without code signing

    Need an option to build OS64 libraries without code signing

    Describe the bug If you are trying to build OS64 or any platform which is not a simulator, you will be forced to code sign the output. When building from a Mac without code signing certificate (no Apple developer account), the CMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM will be set as "123456789A" and the build will fail with error message,

    Code Signing Error: No signing certificate "iOS Development" found: No "iOS Development" signing certificate matching team ID "123456789A" with a private key was found.

    To Reproduce Steps to reproduce the behavior:

    1. Build any project for device (not simulator) such as OS64 without providing CMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM

    Expected behavior Be able build without code signing. Not every libraries are required to be code signed, for example,

    • Static linked libraries do not require code signing
    • App developers may choose to code sign the dynamic library manually late
    • For CIs verifying building, adding code signing will be extra work without obvious benefits

    Environment

    • What version of CMake did you run?
    • Your faulty CMakeLists.txt here:
    --- Paste here ---
    

    Proposal Add an extra option to disable code signing, if CMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM is not set. Can send PR

    bug 
    opened by guoyu-wang 7
  • Error

    Error "invalid argument '-mmacosx-version-min=9.0'"

    I'm using CMake with ios-cmake (3.1.0) inside an Xcode Run Script build phase, to build a 3rd party static library my target links with. However, Clang immediately fails with:

    clang: error: invalid argument '-mmacosx-version-min=9.0' not allowed with '-mios-simulator-version-min=9.0'

    The problem appears to be caused by this statement in ios.toolchain.cmake:

    https://github.com/leetal/ios-cmake/blob/8f7c16a462d17eba7124aba921153382605df288/ios.toolchain.cmake#L545-L546

    If I comment out those two lines, everything builds fine. It seems wrong for the script to be forcing a macOS deployment target when it's not building for macOS, but somehow I'm the only one having trouble as a result...

    Here's the full CMake output:

    CMake options:                  -DCMAKE_TOOLCHAIN_FILE=vendor/ios-cmake/ios.toolchain.cmake                 -DPLATFORM=SIMULATOR64             -DENABLE_PROGRAMS=0             -DENABLE_TESTING=0 -DCMAKE_BUILD_TYPE=Debug -DLWS_WITH_ASAN=1
    -- Building with Xcode version: 11.2.1
    -- Configuring iphonesimulator build for platform: SIMULATOR64, architecture(s): x86_64
    -- Using SDK: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk for platform: SIMULATOR64
    -- Using the default min-version since DEPLOYMENT_TARGET not provided!
    -- Disabling bitcode support by default on simulators. ENABLE_BITCODE not provided for override!
    -- Enabling ARC support by default. ENABLE_ARC not provided!
    -- Hiding symbols visibility by default. ENABLE_VISIBILITY not provided!
    -- Using NON-strict compiler checks by default. ENABLE_STRICT_TRY_COMPILE not provided!
    -- Using C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
    -- Using CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
    -- Using libtool: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool
    -- Using install_name_tool: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool
    -- Using a data_ptr size of 8
    -- Building for minimum iphonesimulator version: 9.0 (SDK version: 13.2)
    -- Version flags set to: -mios-simulator-version-min=9.0
    -- Disabling bitcode support.
    -- Enabling ARC support.
    -- Hiding symbols (-fvisibility=hidden).
    -- Building with Xcode version: 11.2.1
    -- Configuring iphonesimulator build for platform: SIMULATOR64, architecture(s): x86_64
    -- Using SDK: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk for platform: SIMULATOR64 when checking compatibility
    -- Using libtool: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool
    -- Using a data_ptr size of 8
    -- Building for minimum iphonesimulator version: 9.0 (SDK version: 13.2)
    -- Version flags set to: -mios-simulator-version-min=9.0
    -- Disabling bitcode support.
    -- Enabling ARC support.
    -- Hiding symbols (-fvisibility=hidden).
    -- The C compiler identification is AppleClang 11.0.0.11000033
    -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
    -- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -- broken
    CMake Error at /usr/local/Cellar/cmake/3.9.1/share/cmake/Modules/CMakeTestCCompiler.cmake:51 (message):
      The C compiler
      "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang"
      is not able to compile a simple test program.
    
      It fails with the following output:
    
       Change Dir: /Users/snej/Couchbase/CBL/couchbase-lite-ios/build/CouchbaseLite/Build/Intermediates.noindex/LiteCore.build/Debug-iphonesimulator/mbedTLS.build/Objects/mbedtls/CMakeFiles/CMakeTmp
    
      
    
      Run Build Command:"/Applications/Xcode.app/Contents/Developer/usr/bin/make"
      "cmTC_823d2/fast"
    
      /Applications/Xcode.app/Contents/Developer/usr/bin/make -f
      CMakeFiles/cmTC_823d2.dir/build.make CMakeFiles/cmTC_823d2.dir/build
    
      Building C object CMakeFiles/cmTC_823d2.dir/testCCompiler.c.o
    
      
      /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
      -mios-simulator-version-min=9.0 -fobjc-abi-version=2 -fobjc-arc
      -mios-simulator-version-min=9.0 -fobjc-abi-version=2 -fobjc-arc -arch
      x86_64 -isysroot
      /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk
      -mmacosx-version-min=9.0 -o CMakeFiles/cmTC_823d2.dir/testCCompiler.c.o -c
      /Users/snej/Couchbase/CBL/couchbase-lite-ios/build/CouchbaseLite/Build/Intermediates.noindex/LiteCore.build/Debug-iphonesimulator/mbedTLS.build/Objects/mbedtls/CMakeFiles/CMakeTmp/testCCompiler.c
    
    
      clang: error: invalid argument '-mmacosx-version-min=9.0' not allowed with
      '-mios-simulator-version-min=9.0'
    
    opened by snej 7
  • Overwriting CMAKE_OSX_SYSROOT with an invalid value

    Overwriting CMAKE_OSX_SYSROOT with an invalid value

    Here in the commit CMAKE_OSX_SYSROOT becomes like

    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk
    

    All is OK.

    But here in the commit CMAKE_OSX_SYSROOT becomes like

    iphonesimulator
    

    For what purpose?

    And further work is done with CMAKE_OSX_SYSROOT as a path to a file, rather than as the name of the SDK.

    opened by NikitaFeodonit 7
  • Problems with simple C++ sample and your toolkit (FAT/COMBINED)

    Problems with simple C++ sample and your toolkit (FAT/COMBINED)

    Hi,

    First, you make a great toolkit, good job!

    Second, im trying use your toolkit to build a simple FAT/COMBINED library and use on xcode.

    The problem is that generated library is only with one "arch".

    There is a test on my sample repository, and the problem can be checked there: https://travis-ci.com/prsolucoes/ios-lib-test/builds/138626985#L873

    Im calling your toolkit with the params: https://github.com/prsolucoes/ios-lib-test/blob/master/Makefile#L24

    It is strange, because if i run install it generate the library into system folder with all archs inside: /usr/local/lib/libcpp_lib_test.a

    The command to install is here: https://github.com/prsolucoes/ios-lib-test/blob/master/Makefile#L40

    Can you help me understand the problem?

    Thanks.

    opened by paulocoutinhox 6
  • [bug] WatchOS system problem

    [bug] WatchOS system problem

    Hi,

    When i build for watchos and cmake 3.20 i get:

    CMake Error at CMakeLists.txt:214 (add_library):
      Attempting to use @rpath without CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG being
      set.  This could be because you are using a Mac OS X version less than 10.5
      or because CMake's platform configuration is corrupt.
    
    
    CMake Error at CMakeLists.txt:214 (add_library):
      Attempting to use @rpath without CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG being
      set.  This could be because you are using a Mac OS X version less than 10.5
      or because CMake's platform configuration is corrupt.
    

    Do you know what can be wrong?

    bug 
    opened by paulocoutinhox 5
  • [bug]

    [bug]

    Describe the bug A clear and concise description of what the bug is.

    To Reproduce Steps to reproduce the behavior: 1. 2.

    Expected behavior A clear and concise description of what you expected to happen.

    Environment

    • What version of CMake did you run?
    • Your faulty CMakeLists.txt here:
    --- Paste here ---
    
    bug 
    opened by jhebst8810 0
  • [bug]

    [bug]

    Describe the bug A clear and concise description of what the bug is.

    To Reproduce Steps to reproduce the behavior: 1. 2.

    Expected behavior A clear and concise description of what you expected to happen.

    Environment

    • What version of CMake did you run?
    • Your faulty CMakeLists.txt here:
    --- Paste here ---
    
    bug 
    opened by jhebst8810 0
  • build error

    build error

    I downloaded the project,

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

    Terminal error:

    -- [DEFAULTS] Using explicit named language support! E.g., enable_language(CXX) is needed in the project files. -- [DEFAULTS] Enabling bitcode support by default. ENABLE_BITCODE not provided! -- [DEFAULTS] Enabling ARC support by default. ENABLE_ARC not provided! -- [DEFAULTS] Hiding symbols visibility by default. ENABLE_VISIBILITY not provided! -- [DEFAULTS] Using NON-strict compiler checks by default. ENABLE_STRICT_TRY_COMPILE not provided! -- Not setting any manual command-line buildflags, since Xcode is selected as generator. Modifying the Xcode build-settings directly instead. -- Configuring iphoneos build for platform: OS64, architecture(s): arm64 -- Using SDK: -- Using C compiler: -- Using CXX compiler: -- Using libtool: -- Using install name tool: -- Autoconf target triple: aarch64-apple-ios11.0 -- Using minimum deployment version: 11.0 (SDK version: ) -- Merging integrated CMake 3.14+ iOS,tvOS,watchOS,macOS toolchain(s) with this toolchain! -- Using Xcode version: -- CMake version: 3.23.2 -- Using a data_ptr size of: 8 -- Bitcode: Enabled -- ARC: Enabled -- Hiding symbols: Enabled CMake Error at /usr/local/Cellar/cmake/3.23.2/share/cmake/Modules/Platform/iOS-Initialize.cmake:4 (message): is not an iOS SDK Call Stack (most recent call first): /usr/local/Cellar/cmake/3.23.2/share/cmake/Modules/CMakeSystemSpecificInitialize.cmake:21 (include) CMakeLists.txt:2 (project)

    Xcode Version is 13.4.1

    macOS Monterey 12.4

    bug 
    opened by SiuyuenChow 8
  • [Question]Getting undefined symbol _main for watchOS builds when this toolchain file is used

    [Question]Getting undefined symbol _main for watchOS builds when this toolchain file is used

    I tried to use this toolchain file for all the apple kernel related builds that we are doing - macOS, tvOS, watchOS, iOS etc. I believe this toolchain file can also be used if we are trying to build an independent watchOS application ? Currently, when we used this toolchain file and did a build of our application, we get undefined symbol for _main as '_main' is not found for the architecture x86_64. Is there any pointers on how this can be addressed or if there is an example project that can be used with this toolchain file to build a watchOS application ?

    opened by abhimohata 0
  • Preventing the toolchain to run as an environment variable breaks further runs.

    Preventing the toolchain to run as an environment variable breaks further runs.

    This breaks my build:

    if(DEFINED ENV{_IOS_TOOLCHAIN_HAS_RUN})
      return()
    endif()
    set(ENV{_IOS_TOOLCHAIN_HAS_RUN} true)
    

    Where the previous version is fine:

    if(IOS_TOOLCHAIN_HAS_RUN)
      return()
    endif(IOS_TOOLCHAIN_HAS_RUN)
    set(IOS_TOOLCHAIN_HAS_RUN true)
    

    I believe that's because it now sets this as an environment variable, and the second time I try to build a project using the toolchain, it just doesn't do anything.

    Feels weird to me that I need to unset _IOS_TOOLCHAIN_HAS_RUN between two cmake runs, though :thinking:.

    Any thoughts on that? :innocent:

    bug 
    opened by JonasVautherin 2
  • error: Signing for

    error: Signing for "target" requires a development team. Select a development team in the Signing & Capabilities editor. (in target 'target' from project 'libtarget')

    I'm trying to build this crypto library to a library for ios: https://github.com/dfoxfranke/libaes_siv

        cmake .. \
        -G Xcode -DCMAKE_TOOLCHAIN_FILE=../../ios-cmake/ios.toolchain.cmake -DPLATFORM=OS64
        cmake --build .
    

    Is failing with:

    error: Signing for "aes_siv" requires a development team. Select a development team in the Signing & Capabilities editor. (in target 'aes_siv' from project 'libaes_siv')
    error: Bundle identifier is missing. demo doesn't have a bundle identifier. Add a value for PRODUCT_BUNDLE_IDENTIFIER in the build settings editor. (in target 'demo' from project 'libaes_siv')
    error: Bundle identifier is missing. runtests doesn't have a bundle identifier. Add a value for PRODUCT_BUNDLE_IDENTIFIER in the build settings editor. (in target 'runtests' from project 'libaes_siv')
    

    Any idea what I'm doing wrong?

    Btw, I opened the generated the generated xcode project and theres not even an option to set the development team for the aes_siv target.

    Screen Shot 2022-04-16 at 6 57 46 PM bug 
    opened by luca992 4
Releases(4.3.0)
  • 4.3.0(May 20, 2022)

    This version of the toolchain contains lots of bugfixes as well as named languages support (via enable_language() for OBJC and OBJCXX). This should work for most implementations and the default is to enable named language support. If you want the old behaviour, just set the variable NAMED_LANGUAGE_SUPPORT=OFF.

    Source code(tar.gz)
    Source code(zip)
  • 4.2.0(Mar 10, 2021)

    This version includes mostly bugfixes for the macOS builds as well as some other fixes including:

    • CMAKE_FIND_ROOT_PATH is now not being overridden anymore. The toolchain append necessary paths on any existing paths specified by the user. This allows user-specified paths to be searched before the toolchain paths.
    • APPLE_TARGET_TRIPLE property is now being set for manually specified ARCHS as well
    • Excluded some directories from the Catalyst builds since they'd otherwise interfere with the iOS toolchain
    Source code(tar.gz)
    Source code(zip)
  • 4.1.1(Mar 1, 2021)

    This version contains lots of bugfixes as well as the following new features:

    • macOS builds support (more or less just proxying the builds to the host machine)
    • Catalyst support (iOS/iPadOS on macOS)
    • Apple Silicon builds support (requires CMake 3.19.5+)
    • Significant toolchain speedup on Makefile and Ninja generators (possibly more)
    Source code(tar.gz)
    Source code(zip)
  • 3.1.2(Dec 22, 2019)

    Fixes:

    • Lots of formatting and output/prints fixed
    • Fixes a backwards compatibility issue as well that prevented CMake versions older than 3.10 from running correctly
    Source code(tar.gz)
    Source code(zip)
  • 3.1.1(Dec 18, 2019)

  • 3.1.0(Aug 16, 2019)

    Fixes:

    • Minor changes for better third-party compatibility

    Added:

    • New test for building libCurl with combined build support for iOS (arm64 & x86_64).
    Source code(tar.gz)
    Source code(zip)
  • 3.0.2(May 10, 2019)

  • 3.0.1(Apr 8, 2019)

    Fixes:

    • The toolchain have been generalised (removed iOS references in command arguments and variables)
    • Fixes #25 by enforcing 64-bit builds on iOS 10.0+. 32-bit builds have been deprecated officially.
    Source code(tar.gz)
    Source code(zip)
  • 3.0.0(Apr 7, 2019)

    This version comes with the much awaited comined-builds support. That means that CMake now can create FAT-binaries with both device and simultor slices in one go!

    Features:

    • Combined build support. Se the *COMBINED platform options (CMake 3.14+ needed)
    • The Xcode project generator (-G Xcode) now works much better and adheres to most build options set with the toolchain

    Deprecated:

    • IOS_PLATFORM argument have been renamed to PLATFORM to better signal its use. IOS_PLATFORM is now aliased to PLATFORM and thus still works, but will give a deprecation warning

    NOTE! Due to kitware doing an awesome work on CMake, I strongly suggest you all to increase your versions to 3.14+ since the Darwin-based platforms works much better from that version and up ✌

    Source code(tar.gz)
    Source code(zip)
  • 2.2.0(Feb 5, 2019)

  • 2.1.4(Nov 18, 2018)

    Removed:

    • The legacy compiler checks that was forcefully set to succeed have been removed, since they no longer are needed in more recent versions of CMake.
    Source code(tar.gz)
    Source code(zip)
  • 2.1.3(Nov 12, 2018)

  • 2.1.2(Nov 1, 2018)

  • 2.1.1(Oct 23, 2018)

  • 2.1.0(Oct 11, 2018)

    Version 2.1.0 adds support for watchOS and contains a few bug-fixes and smaller improvements.

    Added:

    • watchOS support

    Fixes:

    • Will now "self-heal" upon upgrading Xcode version on consequent builds
    • Some flags set was causing third-party libraries to fail tests
    Source code(tar.gz)
    Source code(zip)
  • 2.0.0(May 4, 2018)

    This release includes better support for lots of third-party libraries due to better compiler recognition options in the toolchain.

    PSA:

    • This release will in some cases break the compatibility with bitcode enabled projects on simulator builds, due to bitcode not being build on simulator anymore, since it is not needed (or even feasible).

    Fixes:

    • Fixes an issue where the bitness of the platforms could not be determined correctly in some cases.
    • Added ELF as compiler platform, since it was missing before
    Source code(tar.gz)
    Source code(zip)
  • 1.1.0(Feb 14, 2018)

    News: Version 1.1.0 brings better stability and improved support for newer toolchains.

    Fixes:

    • Fixes an issue where re-running CMake would cause the whole project to be rebuilt.
    Source code(tar.gz)
    Source code(zip)
  • 1.0.0(Dec 13, 2017)

Owner
Alexander Widerberg
Manager of software development @xmreality
Alexander Widerberg
cmake-avr - a cmake toolchain for AVR projects

cmake-avr - a cmake toolchain for AVR projects Testing the example provided The toolchain was created and tested within the following environment: Lin

Matthias Kleemann 156 Jun 20, 2022
CMake toolchain file and other scripts for the Android NDK

android-cmake CMake is great, and so is Android. This is a collection of CMake scripts that may be useful to the Android NDK community. It is based on

Andrey Kamaev 1.2k Jul 21, 2022
CMake toolchain for all Arduino compatible boards

Arduino CMake Toolchain Arduino CMake toolchain is a CMake toolchain for cross-compiling CMake based projects for all Arduino compatible boards (AVR,

Arun 102 Jul 21, 2022
📦 CMake's missing package manager. A small CMake script for setup-free, cross-platform, reproducible dependency management.

Setup-free CMake dependency management CPM.cmake is a CMake script that adds dependency management capabilities to CMake. It's built as a thin wrapper

CPM.cmake 1.3k Aug 7, 2022
CMake checks cache helper modules – for fast CI CMake builds!

cmake-checks-cache Cross platform CMake projects do platform introspection by the means of "Check" macros. Have a look at CMake's How To Write Platfor

Cristian Adam 59 Jul 7, 2022
CMake scripts for painless usage of SuiteSparse+METIS from Visual Studio and the rest of Windows/Linux/OSX IDEs supported by CMake

CMake scripts for painless usage of Tim Davis' SuiteSparse (CHOLMOD,UMFPACK,AMD,LDL,SPQR,...) and METIS from Visual Studio and the rest of Windows/Lin

Jose Luis Blanco-Claraco 384 Jul 27, 2022
cmake-font-lock - Advanced, type aware, highlight support for CMake

cmake-font-lock - Advanced, type aware, highlight support for CMake

Anders Lindgren 37 Dec 30, 2021
Make CMake less painful when trying to write Modern Flexible CMake

Izzy's eXtension Modules IXM is a CMake library for writing Modern flexible CMake. This means: Reducing the amount of CMake written Selecting reasonab

IXM 105 Jul 18, 2022
CMake module to enable code coverage easily and generate coverage reports with CMake targets.

CMake-codecov CMake module to enable code coverage easily and generate coverage reports with CMake targets. Include into your project To use Findcodec

HPC 77 Jul 3, 2022
unmaintained - CMake module to activate certain C++ standard, feature checks and appropriate automated workarounds - basically an improved version of cmake-compile-features

Compatibility This library provides an advanced target_compile_features() and write_compiler_detection_header(). The problem with those is that they a

Jonathan Müller 72 Apr 14, 2022
[CMake] [BSD-2] CMake module to find ICU

FindICU.cmake A CMake module to find International Components for Unicode (ICU) Library Note that CMake, since its version 3.7.0, includes a FindICU m

julp 29 Apr 26, 2022
CMake macro to determine the language of a header file

CMake Determine Header Language CMake macro to determine the language of a header file. Status Travis CI (Ubuntu) AppVeyor (Windows) Coverage Biicode

ポリ平方 POLYSQUARE 4 Dec 7, 2018
C++ Library Manager for Windows, Linux, and MacOS

Vcpkg: Overview 中文总览 Español 한국어 Français Vcpkg helps you manage C and C++ libraries on Windows, Linux and MacOS. This tool and ecosystem are constant

Microsoft 16.4k Aug 5, 2022
CMake project for BL602 RISC-V processor

bl602_cmake_base CMake project for BL602 RISC-V processor How to build NOTE : This project uses a pre-compiled version of the Buffalo SDK (bl_iot_sdk)

null 9 Jan 6, 2022
curl cmake module libcurl build with msvc x86

curl-msvc Infomation curl cmake module libcurl build with MSVC10.0 arch (x86 | i386) source from https://github.com/curl/curl tags: curl-7_79_1 Usage

Jason Payne 0 May 16, 2022
NeoWorld is a resampler using the CMake build system

NeoWorld is a resampler using the CMake build system. It's designed for utsu, OpenUTAU, and UTAU.

null 4 Jun 24, 2022
A CMake addon that avoids you writing boilerplate code for resource management.

SHader INJ(I)ector SHINJI (originally SHader INJector) is a CMake addon that avoids you writing boilerplate code for resource management and exposes s

Lorenzo Rutayisire 6 Mar 21, 2022
A CMake starter template using CPM

Cmake Starter About A lightweight Cmake project meant for a binary application (not a shared library), tests with catch2 are configured, CPM is the pa

Matt Williams 1 Jul 14, 2022
Non-intrusive CMake dependency management

cmodule Non-intrusive CMake dependency management. Normally CMake's find_package() looks for packages installed on host system (and compiled for host

scapix.com 13 Jun 16, 2022