# SPM build fails for watchOS libraries

**URL:** <https://forums.swift.org/t/spm-build-fails-for-watchos-libraries/40474>\
**Category:** Using Swift\
**Tags:** packagemanager\
**Created:** [September 21, 2020, 5:04pm UTC](https://forums.swift.org/t/spm-build-fails-for-watchos-libraries/40474 "2020-09-21T17:04:38Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![SDGGiesbrecht](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/sdggiesbrecht/32/4768_2.png) [@SDGGiesbrecht](https://forums.swift.org/u/SDGGiesbrecht)\
**Post date:** [September 21, 2020, 8:31pm UTC](https://forums.swift.org/t/spm-build-fails-for-watchos-libraries/40474/10 "2020-09-21T20:31:39Z")

</div>

This is what I do:

> <https://github.com/SDGGiesbrecht/SDGCornerstone/blob/ad52edf9fa206d1d83523e097e8b83bd48939b06/Package.swift#L754-L756>

Since CI builds are from the command line, I simply have that environment variable set. On the rare occasion something fails only on watchOS, I comment out the `if` while I’m working and re‐open Xcode.

It would be nice to have watchOS automatically evade tests in a similar way to how iOS evades executable targets. (Although even that seems to only work from the GUI and not command line invocations.) But as @NeoNacho said, those are the domain of Xcode, not SwiftPM.

---

_[View the full topic](https://forums.swift.org/t/spm-build-fails-for-watchos-libraries/40474)._
