Facing issues trying to migrate an iOS app from CocoaPods to SwiftPM

I'm trying to migrate some C++ and Objective-C dependencies to SwiftPM for our iOS app and Xcode doesn't seem to be respecting the compilation settings of its package dependencies.

I was using a few unsafe flags that should really be specifiable safely to achieve the following:

  • Specify the language because SwiftPM assumes C/C++ -x objective-c++
  • Enable modules -fmodules -fcxx-modules
  • Configure warnings -Wno-error=non-modular-include-in-framework-module

It's also ignoring safe settings, like conditional defines, regardless of if they're C, C++ or Swift settings.

  • .define("WITH_IOS", .when(platforms: [.iOS]))

Is there any way to force Xcode to respect these settings?

FB13404264 for reference.