# How to use a custom build configuration in a Swift Package?

**URL:** <https://forums.swift.org/t/how-to-use-a-custom-build-configuration-in-a-swift-package/36259>\
**Category:** Using Swift\
**Tags:** packagemanager\
**Created:** [May 7, 2020, 7:11pm UTC](https://forums.swift.org/t/how-to-use-a-custom-build-configuration-in-a-swift-package/36259 "2020-05-07T19:11:33Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![1oo7](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/1oo7/32/17598_2.png) [@1oo7](https://forums.swift.org/u/1oo7)\
**Post date:** [May 7, 2020, 7:18pm UTC](https://forums.swift.org/t/how-to-use-a-custom-build-configuration-in-a-swift-package/36259/3 "2020-05-07T19:18:37Z")

</div>

Some replies to this earlier post seemed to indicate that Xcode 11.3 had added support for custom build configs to Swift packages: [Swift package manager and custom build configurations - #4 by vinced45](https://forums.swift.org/t/swift-package-manager-and-custom-build-configurations/29181/4)

If that's wrong and indeed there is still no way to add another config besides Debug or Release, do we have a timeline on when this would be added? This could be deal-breaker for us... the only workaround I've seen, requires the bundle name to be different based on the configuration.

Maybe we can add a check for a compile-time environment variable or something.

Like maybe it would work in our .xcconfig files to have:

```swift
GCC_PREPROCESSOR_DEFINITIONS = TESTING=1

```

Then in Package.swift:

```swift
#if TESTING
// define target including "ENABLE_TESTABILITY=YES"
#else
// don't
#end

```

Question is, when Package.swift is compiled, will config-specific GCC flags have been set yet?

---

_[View the full topic](https://forums.swift.org/t/how-to-use-a-custom-build-configuration-in-a-swift-package/36259)._
