- Notifications
You must be signed in to change notification settings - Fork53
Apple support for Bazel rules
License
bazelbuild/apple_support
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Apple Support forBazel
This repository contains theApple CC toolchain,Apple relatedplatforms andconstraints definitions, and small helper functionsfor rules authors targeting Apple platforms.
If you want to build iOS, tvOS, visionOS, watchOS, or macOS apps, userules_apple.
If you want to build Swift userules_swift.
Seethe documentation for the helper rules provided by thisrepository.
Copy theMODULE.bazel orWORKSPACE snippets fromthe releasespage into yourproject.
The Apple CC toolchain in this repository provides toolchains forbuilding for Apple platforms besides macOS. Since Bazel 7 this toolchainis required when targeting those platforms.
The toolchain supports using a full Xcode installation or the XcodeCommand Line Tools.
For Bazel 7+ the only setup that is required is to haveapple_supportin yourMODULE.bazel (even if you're not referencing it directly) orWORKSPACE, which you can copy fromthe releasespage into yourproject.
If you also depend onrules_cc,apple_support must comeaboverules_cc in yourMODULE.bazel orWORKSPACE file because Bazelselects toolchains based on which is registered first.
There are many different flags you can flip to configure how thetoolchain works. Here are some of the more commonly useful ones:
- Setting
DEVELOPER_DIRin the environment. This is recommended sothat the toolchain can be invalidated when theDEVELOPER_DIRchanges, which ensures that toolchain binaries will be rebuilt withthe new version of Xcode so that caches are correctly shared acrossmachines. - Setting
BAZEL_ALLOW_NON_APPLICATIONS_XCODE=1in the environment (orusing--repo_env) allows the toolchain to discover Xcode versionsoutside of the/Applicationsdirectory to avoid header inclusionerrors from bazel. This is not enabled by default because/Applicationsis the standard directory, and this improves toolchainsetup performance.
About
Apple support for Bazel rules
Resources
License
Contributing
Security policy
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.