opened 04:54PM - 13 Dec 21 UTC
bug
| | |
|------------------|-----------------|…
|Previous ID | SR-15589 |
|Radar | None |
|Original Reporter | Cameron (JIRA User) |
|Type | Bug |
<details>
<summary>Environment</summary>
macOS 12.0.1, Xcode 13.2 (13C90)
macOS 12.3, Xcode 13.3 (13E113)
</details>
<details>
<summary>Additional Detail from JIRA</summary>
| | |
|------------------|-----------------|
|Votes | 1 |
|Component/s | Package Manager |
|Labels | Bug |
|Assignee | None |
|Priority | Medium |
md5: 1d817448ccceb0cac34d0ba118636b94
</details>
**Issue Description:**
I am working on a library for iOS and macOS platforms. When on iOS, I'd like to include a specific, iOS only, dependency. I am using conditional target dependencies to achieve this:
``` java
import PackageDescription
let package = Package(
name: "MyLibrary",
products: [
.library(name: "MyLibrary", targets: ["MyLibrary"])
],
dependencies: [
.package(name: "Embrace", url: "https://github.com/embrace-io/embrace-spm", from: "5.7.0")
],
targets: [
.target(
name: "MyLibrary",
dependencies: [
.product(name: "Embrace", package: "Embrace", condition: .when(platforms: [.iOS]))
]
)
]
)
```
However, when I compile on a macOS target, I get the following error which feels incorrect to me:
/Users/cbp/Library/Developer/Xcode/DerivedData/MyLibrary-hbfrabjxsrphnbbioeeyckityvdv/SourcePackages/checkouts/embrace-spm/Embrace.xcframework:1:1: While building for macOS, no library for this platform was found in '/Users/cbp/Library/Developer/Xcode/DerivedData/MyLibrary-hbfrabjxsrphnbbioeeyckityvdv/SourcePackages/checkouts/embrace-spm/Embrace.xcframework'.
It's true that the Embrace library does not have a macOS version, but I had figured my `condition: .when(platforms: [.iOS])` would work around that.