I have a Package.swift which leverages C++ interop with the following target:
.target(
name: "MyTarget",
dependencies: ["CxxDependency"],
swiftSettings: [
.interoperabilityMode(.Cxx)
]),
...and a single test target:
.testTarget(
name: "MyTargetTests",
dependencies: ["MyTarget"],
swiftSettings: [
.interoperabilityMode(.Cxx)
]),
However when I run swift test
I get the following error:
error: module 'MyTargetTests' was built with C++ interoperability enabled, but current compilation does not enable C++ interoperability
@testable import MyTargetTests
^
Running swift test -Xswiftc -cxx-interoperability-mode=default
fixes the issue, so this isn't a huge deal. Just curious: is there a way to get this "special" project being compiled to run the tests to infer the compatibility mode?