I'm trying to add a build target to my package that can only be built on macOS, yet for some reason SPM always attempts to build it on Linux too. SE-0273 seems to suggest that what I'm trying to achieve should be possible:
... but when building, the Package Manager will avoid building the disabled dependency and will link the correct library depending on the platform.
targets: [
.target(
name: "Frontend",
dependencies: [
.target(name: "PeripheryKit"),
.target(name: "XcodeSupport", condition: .when(platforms: [.macOS])),
]
),
.target(
name: "PeripheryKit"
),
.target(
name: "XcodeSupport",
dependencies: [
.target(name: "PeripheryKit"),
.product(name: "XcodeProj", package: "XcodeProj"),
]
),
]
SPM always attempts to build XcodeSupport on Linux despite the macOS platform condition on Frontend. No other target has XcodeSupport as a dependency. Is this a bug or am I misinterpreting SE-0273?