Skip to content

Commit 09bef39

Browse files
committed
Suppress warnings for remote Clang targets
This mirrors behavior of remote swift targets which suppress warnings as well. (cherry picked from commit 398dab8)
1 parent b21f730 commit 09bef39

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Sources/Build/BuildDescription/ClangTargetBuildDescription.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,15 @@ package final class ClangTargetBuildDescription {
311311
args += ["-I", includeSearchPath.pathString]
312312
}
313313

314+
// suppress warnings if the package is remote
315+
if self.package.isRemote {
316+
args += ["-w"]
317+
// `-w` (suppress warnings) and `-Werror` (warnings as errors) flags are mutually exclusive
318+
if let index = args.firstIndex(of: "-Werror") {
319+
args.remove(at: index)
320+
}
321+
}
322+
314323
return args
315324
}
316325

0 commit comments

Comments
 (0)