# Build Cache for Xcode - option not to force SWIFT\_ENABLE\_EXPLICIT\_MODULES

**URL:** <https://discuss.bitrise.io/t/build-cache-for-xcode-option-not-to-force-swift-enable-explicit-modules/25664>\
**Category:** Feature Requests\
**Tags:** build-cache, ios, xcode\
**Created:** [November 12, 2025, 1:57am UTC](https://discuss.bitrise.io/t/build-cache-for-xcode-option-not-to-force-swift-enable-explicit-modules/25664 "2025-11-12T01:57:03Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![danube83](https://avatars.discourse-cdn.com/v4/letter/d/71e660/32.png) [@danube83](https://discuss.bitrise.io/u/danube83)\
**Post date:** [November 12, 2025, 1:57am UTC](https://discuss.bitrise.io/t/build-cache-for-xcode-option-not-to-force-swift-enable-explicit-modules/25664/1 "2025-11-12T01:57:03Z")

</div>

## Problem Statement

When the build cache option is enabled, `SWIFT_ENABLE_EXPLICIT_MODULES=YES` is automatically added to CLI xcodebuild options, which affects all projects in the build environment.

However, some of our projects **require** `SWIFT_ENABLE_EXPLICIT_MODULES=NO` to be set. This is mandatory for our app security solution to work properly.

## Current Behavior

- Build cache option automatically sets `SWIFT_ENABLE_EXPLICIT_MODULES=YES` globally
- This setting is applied to all projects regardless of their individual requirements
- No way to override this on a per-project basis
- Projects that need `SWIFT_ENABLE_EXPLICIT_MODULES=NO` cannot use build cache currently

## Requested Feature

We would like the build cache to respect project-specific settings. Specifically:

1. **Project-level configuration** : Allow the build cache to check the project’s build settings and respect `SWIFT_ENABLE_EXPLICIT_MODULES` value set in the project
2. **Conditional cache behavior** : If a project has `SWIFT_ENABLE_EXPLICIT_MODULES=NO` in its build settings, the build cache should not override it with `YES`
3. **Flexibility** : Projects should be able to opt-in or opt-out of the automatic `SWIFT_ENABLE_EXPLICIT_MODULES=YES` behavior

Thank you for considering this feature request!

---

<div class="post-metadata">

**Author:** ![viktorbenei](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/viktorbenei/32/18_2.png) [@viktorbenei](https://discuss.bitrise.io/u/viktorbenei)\
**Post date:** [November 12, 2025, 12:31pm UTC](https://discuss.bitrise.io/t/build-cache-for-xcode-option-not-to-force-swift-enable-explicit-modules/25664/2 "2025-11-12T12:31:41Z")

</div>

Thanks for the detailed feature request @danube83 !

We’ll look into this soon and discuss what the right solution would be.

---

<div class="post-metadata">

**Author:** ![viktorbenei](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/viktorbenei/32/18_2.png) [@viktorbenei](https://discuss.bitrise.io/u/viktorbenei)\
**Post date:** [November 17, 2025, 2:47pm UTC](https://discuss.bitrise.io/t/build-cache-for-xcode-option-not-to-force-swift-enable-explicit-modules/25664/3 "2025-11-17T14:47:32Z")

</div>

Update: we discussed the potential solutions, and we plan to:

- Add a new option to the Step & CLI to not to set any Xcode settings, except the `proxy` path.
  - This means that additional setups might be required in your Xcode project settings.

- We’ll also provide a DevCenter guide about how to use this option (what needs to be set in Xcode project settings), and we’ll link to it in the Step Input’s description.

We’ll try to implement this as soon as possible.

---

<div class="post-metadata">

**Author:** ![viktorbenei](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/viktorbenei/32/18_2.png) [@viktorbenei](https://discuss.bitrise.io/u/viktorbenei)\
**Post date:** [November 20, 2025, 4:32pm UTC](https://discuss.bitrise.io/t/build-cache-for-xcode-option-not-to-force-swift-enable-explicit-modules/25664/4 "2025-11-20T16:32:42Z")

</div>

Update: FAQ page will go live soon, but in the meantime we already released the related Step update. Short guide:

- Select the `Build Cache for Xcode` step in the workflow editor
- Set the input `Skip passing cache flags to xcodebuild` to `true`  
 ![Screenshot 2025-11-20 at 5.28.44 PM](https://us1.discourse-cdn.com/flex016/uploads/bitrise/original/2X/c/c1e494f5e9261fa668f59e370ff4af775cc23f1b.png)
  - Note: if you don’t see this input make sure you use at lest version `0.4.1` or newer.

- And follow the guide below to configure your Xcode project:

> How to pass compilation cache build flags manually?
> 
> If you would like to enable compilation caching manually per-project, you can disable passing the necessary flags in the Build cache for Xcode step (on Bitrise CI), by setting the step input “Skip passing cache flags to xcodebuild”. If you are using the Bitrise Build Cache CLI locally, you can pass the `--cache-skip-flags` to your `activate xcode` command.
> 
> In this case, you will need to manually set some flags per-build, or in your project’s build settings. Note: some might already have a named version in Xcode IDE, e.g. “Enable Compilation Caching”, or “Explicitly Built Modules”. These are the flags we pass by default:
> 
> - “COMPILATION\_CACHE\_ENABLE\_PLUGIN”: “YES”
> - “COMPILATION\_CACHE\_ENABLE\_INTEGRATED\_QUERIES”: “YES”
> - “COMPILATION\_CACHE\_ENABLE\_DETACHED\_KEY\_QUERIES”: “YES”
> - “SWIFT\_ENABLE\_COMPILE\_CACHE”: “YES”
> - “SWIFT\_ENABLE\_EXPLICIT\_MODULES”: “YES”
> - “SWIFT\_USE\_INTEGRATED\_DRIVER”: “YES”
> - “CLANG\_ENABLE\_COMPILE\_CACHE”: “YES”
> - “CLANG\_ENABLE\_MODULES”: “YES”
> 
> More information about how we pass these flags on Bitrise can be found in this blog post: [Lifting the hood on Build Cache for Xcode - Bitrise Blog](https://bitrise.io/blog/post/lifting-the-hood-on-build-cache-for-xcode)

If you have any questions let us know!

---

<div class="post-metadata">

**Author:** ![viktorbenei](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/viktorbenei/32/18_2.png) [@viktorbenei](https://discuss.bitrise.io/u/viktorbenei)\
**Post date:** [November 21, 2025, 2:11pm UTC](https://discuss.bitrise.io/t/build-cache-for-xcode-option-not-to-force-swift-enable-explicit-modules/25664/5 "2025-11-21T14:11:18Z")

</div>

Update: docs are now also live: [Xcode Compilation Cache FAQ](https://docs.bitrise.io/en/bitrise-build-cache/build-cache-for-xcode/xcode-compilation-cache-faq.html#how-to-pass-compilation-cache-build-flags-manually-)

---

<div class="post-metadata">

**Author:** ![danube83](https://avatars.discourse-cdn.com/v4/letter/d/71e660/32.png) [@danube83](https://discuss.bitrise.io/u/danube83)\
**Post date:** [November 26, 2025, 1:48am UTC](https://discuss.bitrise.io/t/build-cache-for-xcode-option-not-to-force-swift-enable-explicit-modules/25664/6 "2025-11-26T01:48:51Z")

</div>

Thank you for your updates.

---

<div class="post-metadata">

**Author:** ![viktorbenei](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/viktorbenei/32/18_2.png) [@viktorbenei](https://discuss.bitrise.io/u/viktorbenei)\
**Post date:** [February 24, 2026, 1:49am UTC](https://discuss.bitrise.io/t/build-cache-for-xcode-option-not-to-force-swift-enable-explicit-modules/25664/7 "2026-02-24T01:49:27Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
