I'd like to propose adding a new top-level property to the Package structure that makes it easier to define default settings for all Swift targets. Per-target settings would be merged with higher precedence. I'm also proposing this specifically to Swift and not C/C++, because I think this is by far the most-common case. But, if there are strong feelings here, I'm definitely open to expanding the idea.
I think this will need a lot more concrete design, potentially with different merging strategies based on the type of settings. For example, Xcode has a pretty sophisticated model here, with multi- and single-value settings, $(inherited) etc -- a lot of the cases that solves will likely come up in a multi-layer build settings model for SwiftPM as well.
There's also the question of how to address potential ambiguity with swiftLanguageVersion (see SE-0435) since that would also be part of SwiftSetting now, but there's an existing package level property for this already.
I thought about this! I opted for more straight-forward spelling because I think the risk for ambigitity/confusion is small. But I'm definitely open to it!
You are absolutely right! I didn't even know a multi-layer settings model existed. Where can I learn more about it?
Shoot. Am I correct that there is currently no validation on the strings that go into these settings vs the active language model? And if I am, I'm inclined to use that as precedent to say that, just like there, you have to be equally careful.