I'm at the moment trying to package a C++ library in a way that it can be used with a SwiftPM project via C++ interop. I've got it working almost-perfectly, but the one remaining issue is that I have to specify the "-std=c++17" flag via the unsafeFlagsCSetting in SwiftPM, which (as I understand it) prevents the package from being depended on. I tried adding this flag to the pkg-config file but I get warning: prohibited flag(s): -std=c++17.
On macOS, I can probably work around this by creating an xcframework that can be depended on, but on Linux IIRC the only way to depend on a precompiled binary at the moment is via systemLibrary.
Does putting “requires cplusplus17” in the module.modulemap automatically update flags or will it just ignore the module if the flag wasn’t provided?
The requires directives in the module map are only used to verify the language mode used by the Clang importer in Swift, it doesn't actually change the settings like whether C++ is enabled, or which standard is used.