Skip to content

Commit a47085c

Browse files
committed
Fix use of extraCPPFlags
Since we are using `swiftc` as the linker driver, we need to prefix any C specifc arguments with `-Xcc`. rdar://100575898
1 parent d1d2d17 commit a47085c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Sources/Build/BuildPlan.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2080,7 +2080,8 @@ public class BuildPlan {
20802080
// Note: This will come from build settings in future.
20812081
for target in dependencies.staticTargets {
20822082
if case let target as ClangTarget = target.underlyingTarget, target.isCXX {
2083-
buildProduct.additionalFlags += self.buildParameters.toolchain.extraCPPFlags
2083+
// Since we are using `swiftc` as the linker driver, we need to prefix these.
2084+
buildProduct.additionalFlags += self.buildParameters.toolchain.extraCPPFlags.flatMap({ ["-Xcc", $0] })
20842085
break
20852086
}
20862087
}

0 commit comments

Comments
 (0)