Skip to content

Commit 0c5312b

Browse files
authored
🍒[cxx-interop] Do not pass the C++ standard if C++ interop is not enabled (#7194)
This fixes the Swift PR testing failures. ### Motivation: If C++ interop is not enabled, SwiftPM should not pass `-Xcc -std=c++17` flags. ### Result: Only pass these flags if C++ interop is enabled. Original PR: #7188 (cherry picked from commit 351222f)
1 parent ed5461c commit 0c5312b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

‎Sources/Build/BuildDescription/SwiftTargetBuildDescription.swift

+5-3
Original file line numberDiff line numberDiff line change
@@ -545,12 +545,14 @@ public final class SwiftTargetBuildDescription {
545545
let dependencySwiftFlags = dependencyScope.evaluate(.OTHER_SWIFT_FLAGS)
546546
if let interopModeFlag = dependencySwiftFlags.first(where: { $0.hasPrefix("-cxx-interoperability-mode=") }) {
547547
args += [interopModeFlag]
548+
if interopModeFlag != "-cxx-interoperability-mode=off" {
549+
if let cxxStandard = self.package.manifest.cxxLanguageStandard {
550+
args += ["-Xcc", "-std=\(cxxStandard)"]
551+
}
552+
}
548553
break
549554
}
550555
}
551-
if let cxxStandard = self.package.manifest.cxxLanguageStandard {
552-
args += ["-Xcc", "-std=\(cxxStandard)"]
553-
}
554556
default: break
555557
}
556558

0 commit comments

Comments
 (0)