# Re-examining meaning of global options in cross-compilation contexts

**URL:** <https://forums.swift.org/t/re-examining-meaning-of-global-options-in-cross-compilation-contexts/72583>\
**Category:** Package Manager\
**Created:** [June 18, 2024, 10:42pm UTC](https://forums.swift.org/t/re-examining-meaning-of-global-options-in-cross-compilation-contexts/72583 "2024-06-18T22:42:22Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Finagolfin](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/finagolfin/32/34388_2.png) [@Finagolfin](https://forums.swift.org/u/Finagolfin)\
**Post date:** [September 16, 2024, 4:50pm UTC](https://forums.swift.org/t/re-examining-meaning-of-global-options-in-cross-compilation-contexts/72583/5 "2024-09-16T16:50:08Z")

</div>

Only seeing this thread now that it's recently discussed again, but I definitely think this should be fixed, as [I pointed out that this seemed to be a problem with Rust macros that Swift should try to avoid years ago](https://forums.swift.org/t/a-possible-vision-for-macros-in-swift/60900/35). Either option seems fine to me, as SwiftPM only started building so much code for the host alongside cross-compilation recently, so you could argue 2. is more intuitive because most people only expected these flags to apply to the target.

> [@dschaefer2](#):
>
> One thing I've been looking at is how we can support multiple targets in a build.

You'd probably want to use [SDK bundles](https://github.com/swiftlang/swift-evolution/blob/main/proposals/0387-cross-compilation-destinations.md) for that? One deficiency with SwiftPM is that it seems to support [building for multiple architectures with one invocation when targeting macOS](https://github.com/swiftlang/swift-package-manager/blob/21535dcd57cb8ebb7ca04167458de702d4614e10/Utilities/bootstrap#L828), but not for other target platforms.

> [@dschaefer2](#):
>
> To support this, I'm not sure these command line switches make sense. I think they need to be brought into the manifest or some other build config file or make it easier to make SDKs that can be referenced by the manifests.

Not sure what you're suggesting here, that we remove these CLI flags altogether or change them to support multiple targets also. The benefit of CLI flags is that they allow quickly trying or overriding flags without pulling in more "build config files" and other heavier config. Multiple targets seem such a specialized use case that I'm not sure it needs CLI support yet, while these flags are definitely useful for the much more common host and single cross-compilation target scenarios.

---

_[View the full topic](https://forums.swift.org/t/re-examining-meaning-of-global-options-in-cross-compilation-contexts/72583)._
