当前位置: 首页 > 软件库 > 开发工具 > >

ios-cmake

授权协议 BSD-3-Clause License
开发语言 C/C++
所属分类 开发工具
软件类型 开源软件
地区 不详
投 递 者 尉迟景福
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

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 forthe given platform. These FAT-libraries include slices for both device and simulator, making the distribution andusage 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 theLIPO tool. More information on how to combine libraries with LIPO is readily available on the net.

Thanks To

  • 地址:https://github.com/leetal/ios-cmake ios-cmake作为iOS版的Cmake编译工具链,watchOS 和 tvOS开发支持全部的模拟器和相关选项。 Tested with the following combinations: XCode 5.x, iOS SDK 7 XCode 6.1.x, iOS SDK 8.1 XCode 8.2.x, iOS

  • CMake 简介 CMake是一个跨平台的安装(编译)工具,可以用简单的语句来描述所有平台的安装(编译过程)。他能够输出各种各样的makefile或者project文件,能测试编译器所支持的C++特性,类似UNIX下的automake。 CMake使用方法 CMake的所有的语句都写在一个叫:CMakeLists.txt的文件中。当CMakeLists.txt文件确定后,可以用ccmake命令对相

  • 命令格式 add_executable (<name> [WIN32] [MACOSX_BUNDLE]       [EXCLUDE_FROM_ALL]       [source1] [source2 ...]) add_executable (<name> IMPORTED [GLOBAL]) add_executable (<name> ALIAS <target>)   使用指定的源文件来

  • 本文主要记录 CMAKE生成iOS,iPad 工程 和 静态库的一些方法 cmake打印log调试 在开发中打印log 是最快的调试方法 在cmake 中可以使用下列方法来进行打印 if(APPLE) set_target_properties(${module_name} PROPERTIES XCODE_ATTRIBUTE_CLANG_ENABLE_OBJC_ARC "YES"

  • 交叉编译命令 Android # armeabi-v7a cmake ../ -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK/build/cmake/android.toolchain.cmake -DANDROID_ABI="armeabi-v7a" -DANDROID_ARM_NEON=ON -DANDROID_PLATFORM=android-14 # arm64-

 相关资料
  • ios

    Native.js for iOS封装一条通过JS语法直接调用Native Objective-C接口通道,通过plus.ios可调用几乎所有的系统API。 方法: importClass: 导入Objective-C类对象 newObject: 创建实例对象 deleteObject: 销毁实例对象 invoke: 调用对象(类对象/示例对象)的方法 implements: 实现代理的方法 cu

  • iOS

    iOS 是由苹果公司为 iPhone 开发的操作系统。它主要是给iPhone、iPod touch、iPad 以及 Apple TV 使用。就像其基于的 Mac OS X 操作系统一样,它也是以 Darwin 为基础的。原本這個系统名为 iPhone OS,直到 2010 年 6 月 7 日 WWDC 大會上宣布改名为 iOS。 iOS 的系统架构分为四個层次:核心操作系统层(the Core O

  • Native 对外接口 注册 SDK 默认的 Module、Handler 和 Component 注册自定义 module、Handler 和 Component 重置 JSFramework Handler (对应于 Android 的 Adapter) 介绍 WXImgLoaderDefaultImpl 图片下载 handler。Weex 会把需要设置图片的 View 和 URL 透露出来,

  • 概述 一 SDK导入及Xcode配置 二 标准接口快速集成 三 扩展功能 四 基本的事件监听 五 设置加密方式 六 语音识别功能 七 推送集成 八 版本更新说明 九 常见错误码 十 SDK下载

  • 这里介绍 FinClip 小程序 SDK 提供了哪些能力,以及API的详细说明和使用示例。 1. 基础API 1.1 SDK初始化 在使用小程序的API之前,需要先初始化小程序SDK。只有成功初始化之后,才能使用SDK提供的API,否则 API都无法调用。 初始化SDK的API如下: /// 初始化SDK /// @param config 配置对象 /// @param error 初始化失败时

  • iOS Objective-C SDK iOS Swift SDK