Hi - thanks for the quick response. I'll try to answer as best as I can.
Could you tell me more about these watchOS targets? My primary curiosity is how they are able to build successfully even during a normal build, if their dependencies do not support watchOS.
I mentioned at the bottom of my original post that our app is "[a mixture of] SPM packages and traditional target structure". This is mostly because SPM was introduced after our app was already published and created. We've slowly been migrating old features to SPM, and new features get added to SPM. The reason we love SPM is it introduces modularity for us, and enables greater code sharing.
The way we decided to structure SPM within the context of all of our targets is one shared Package.swift file. This is because so many of our targets share the same code, it seemed easier at the time to keep all our various "libraries" within one SPM package (I hope that makes sense).
So our one Package.swift declares all platforms like this:
platforms: [
.iOS("17.0"),
.watchOS("10.0"),
.tvOS("17.0"),
.visionOS("1.0"),
]
This doesn't seem to affect our "normal" build because the relevant watch packages don't depend on the libraries that aren't compatible. But for some reason when -exportLocalization flag is added, it attempts to build ALL targets for watch since that's declared as a platform at the top.
The build setting SWIFT_EMIT_LOC_STRINGS can be set to NO on a target if you'd like to avoid building and using the compiler to extract strings from that target during export. However, that also will prevent those strings from syncing to String Catalogs in that target after your own builds.
I believe I tried this earlier, but let me check again to confirm that it didn't seem to have an effect. I don't believe I've tried LOCALIZATION_EXPORT_SUPPORTED so let me check that too.
Thanks in advance for all your help. I'll look into adding a feedback, but getting a sample project might be tricky since this seems like a pretty narrow edge case. I'll see what I can do.