{"id":13562442,"url":"https://github.com/leetal/ios-cmake","last_synced_at":"2025-05-14T03:09:25.754Z","repository":{"id":38361751,"uuid":"80814363","full_name":"leetal/ios-cmake","owner":"leetal","description":"A CMake toolchain file for iOS/iPadOS, visionOS, macOS, watchOS \u0026 tvOS C/C++/Obj-C++ development","archived":false,"fork":false,"pushed_at":"2025-03-11T18:17:06.000Z","size":505,"stargazers_count":2029,"open_issues_count":17,"forks_count":463,"subscribers_count":45,"default_branch":"master","last_synced_at":"2025-04-11T00:43:42.760Z","etag":null,"topics":["c","catalyst","cmake","cmake-scripts","cmake-toolchain","cpp","ios","ios-cmake","ios-development","macos","macosx","objective-c","tvos","tvos-cmake","tvos-development","tvos-simulator","visionos","watchos","watchos-cmake","watchos-development"],"latest_commit_sha":null,"homepage":"","language":"CMake","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leetal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["leetal"]}},"created_at":"2017-02-03T09:17:19.000Z","updated_at":"2025-04-10T23:03:43.000Z","dependencies_parsed_at":"2023-11-16T10:29:28.188Z","dependency_job_id":"923b4f3b-d19b-464c-8b2f-37424252739b","html_url":"https://github.com/leetal/ios-cmake","commit_stats":null,"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leetal%2Fios-cmake","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leetal%2Fios-cmake/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leetal%2Fios-cmake/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leetal%2Fios-cmake/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leetal","download_url":"https://codeload.github.com/leetal/ios-cmake/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254059509,"owners_count":22007768,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","catalyst","cmake","cmake-scripts","cmake-toolchain","cpp","ios","ios-cmake","ios-development","macos","macosx","objective-c","tvos","tvos-cmake","tvos-development","tvos-simulator","visionos","watchos","watchos-cmake","watchos-development"],"created_at":"2024-08-01T13:01:08.665Z","updated_at":"2025-05-14T03:09:20.724Z","avatar_url":"https://github.com/leetal.png","language":"CMake","funding_links":["https://github.com/sponsors/leetal"],"categories":["CMake","Tools","Open Source"],"sub_categories":["Tools"],"readme":"A CMake toolchain file for iOS (+ Catalyst), watchOS, tvOS and macOS development with full simulator support and toggleable options!\n\n# ios-cmake\n\n[![catalyst-jobs](https://github.com/leetal/ios-cmake/actions/workflows/catalyst.yml/badge.svg)](https://github.com/leetal/ios-cmake/actions/workflows/catalyst.yml) \u0026nbsp; [![combined-jobs](https://github.com/leetal/ios-cmake/actions/workflows/combined.yml/badge.svg)](https://github.com/leetal/ios-cmake/actions/workflows/combined.yml) \u0026nbsp; [![ios-jobs](https://github.com/leetal/ios-cmake/actions/workflows/ios.yml/badge.svg)](https://github.com/leetal/ios-cmake/actions/workflows/ios.yml)\n\n[![macos-jobs](https://github.com/leetal/ios-cmake/actions/workflows/macos.yml/badge.svg)](https://github.com/leetal/ios-cmake/actions/workflows/macos.yml) \u0026nbsp; [![tvos-jobs](https://github.com/leetal/ios-cmake/actions/workflows/tvos.yml/badge.svg)](https://github.com/leetal/ios-cmake/actions/workflows/tvos.yml) \u0026nbsp; [![watchos-jobs](https://github.com/leetal/ios-cmake/actions/workflows/watchos.yml/badge.svg)](https://github.com/leetal/ios-cmake/actions/workflows/watchos.yml)\n\n[![visionos-jobs](https://github.com/leetal/ios-cmake/actions/workflows/visionos.yml/badge.svg)](https://github.com/leetal/ios-cmake/actions/workflows/visionos.yml)\n\n## Platform flag options (-DPLATFORM=_flag_)\n\n* _OS_ - to build for iOS (armv7, armv7s, arm64) -- **DEPRECATED in favour of OS64**\n* _OS64_ - to build for iOS (arm64 only)\n* _OS64COMBINED_ - to build for iOS \u0026 iOS Simulator (FAT lib) (arm64, x86_64)\n* _SIMULATOR_ - to build for iOS simulator 32 bit (i386) -- **DEPRECATED**\n* _SIMULATOR64_ - to build for iOS simulator 64 bit (x86_64)\n* _SIMULATORARM64_ - to build for iOS simulator 64 bit (arm64)\n* _SIMULATOR64COMBINED_ - to build for iOS simulator 64 bit (FAT lib) (arm64, x86_64)\n* _VISIONOS_ - to build for visionOS (arm64) -- **Apple Silicon Required**\n* _VISIONOSCOMBINED_ - to build for visionOS \u0026 visionOS Simulator (FAT lib) (arm64) -- **Apple Silicon Required**\n* _SIMULATOR_VISIONOS_ - to build for visionOS Simulator (arm64) -- **Apple Silicon Required**\n* _TVOS_ - to build for tvOS (arm64)\n* _TVOSCOMBINED_ - to build for tvOS \u0026 tvOS Simulator (arm64, x86_64)\n* _SIMULATOR_TVOS_ - to build for tvOS Simulator (x86_64)\n* _SIMULATORARM64_TVOS_ = to build for tvOS Simulator (arm64)\n* _WATCHOS_ - to build for watchOS (armv7k, arm64_32)\n* _WATCHOSCOMBINED_ - to build for watchOS \u0026 Simulator (armv7k, arm64_32, x86_64)\n* _SIMULATOR_WATCHOS_ - to build for watchOS Simulator (x86_64)\n* _SIMULATORARM64_WATCHOS_ = to build for watchOS Simulator (arm64)\n* _SIMULATOR_WATCHOSCOMBINED_ = to build for watchOS Simulator (FAT lib) (arm64, x86_64)\n* _MAC_ - to build for macOS (x86_64)\n* _MAC_ARM64_ - to build for macOS on Apple Silicon (arm64)\n* _MAC_UNIVERSAL_ - to build for macOS on x86_64 and Apple Silicon (arm64) combined\n* _MAC_CATALYST_ - to build iOS for Mac (Catalyst, x86_64)\n* _MAC_CATALYST_ARM64_ - to build iOS for Mac on Apple Silicon (Catalyst, arm64)\n* _MAC_CATALYST_UNIVERSAL_ - to build iOS for Mac on x86_64 and Mac on arm64 combined (Catalyst, x86_64, arm64)\n\n# Example usage\n\n**_NOTE_: Change the `-DPLATFORM` to an applicable value if targeting another platform.**\n\n```bash\ncd example/example-lib\ncmake -B build -G Xcode -DCMAKE_TOOLCHAIN_FILE=../../ios.toolchain.cmake -DPLATFORM=OS64\ncmake --build build --config Release\n```\n\nThis will build the library for the given PLATFORM. In this case, iOS with the arm64 architecture.\n\n## COMBINED Options\n\nThe options called *COMBINED (OS64COMBINED, TVOSCOMBINED and WATCHOSCOMBINED) will build complete FAT-libraries for\nthe given platform. These FAT-libraries include slices for both device and simulator, making the distribution and\nusage of the library much more simple!\n\nExample:\n\n```bash\ncmake . -G Xcode -DCMAKE_TOOLCHAIN_FILE=../../ios.toolchain.cmake -DPLATFORM=OS64COMBINED\ncmake --build . --config Release\ncmake --install . --config Release # Necessary to build combined library\n```\n\n**_NOTE_: The COMBINED options _ONLY_ work with the Xcode generator (-G Xcode) on CMake versions 3.14+!**\n\n---\n\n### Exposed Variables\n\n`XCODE_VERSION` - Version number (not including Build version) of Xcode detected.\n\n`SDK_VERSION` - Version of SDK being used.\n\n`CMAKE_OSX_ARCHITECTURES` - Architectures being compiled for (generated from PLATFORM).\n\n`APPLE_TARGET_TRIPLE` - Used by autoconf build systems.\n\n### Additional Options\n\n`-DENABLE_BITCODE=(BOOL)` - Disabled by default, specify TRUE or 1 to enable bitcode\n\n`-DENABLE_ARC=(BOOL)` - Enabled by default, specify FALSE or 0 to disable ARC\n\n`-DENABLE_VISIBILITY=(BOOL)` - Disabled by default, specify TRUE or 1 to enable symbol visibility support\n\n`-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)\n\n`-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)\n\n__*To combine all platforms into the same FAT-library, either build any of the \"*COMBINED*\" platform types OR use the\nLIPO tool. More information on how to combine libraries with LIPO is readily available on the net.*__\n\n## Thanks To\n\n* 🌟 A heartfelt thank you to everyone who contributes to keeping this repository up-to-date! Your support and collaboration are invaluable in managing and tracking all the changes. Your help is greatly appreciated! 🙏🎉\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleetal%2Fios-cmake","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleetal%2Fios-cmake","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleetal%2Fios-cmake/lists"}