Skip to content

Commit 57491cb

Browse files
committed
Pass -Werror when building the LLVM wrapper
Enabling warning_into_errors() only whether it's in rust-lang/rust CI, so deprecated uses of LLVM methods can be treated as errors.
1 parent 919c409 commit 57491cb

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

compiler/rustc_llvm/build.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,11 @@ fn main() {
171171
let cxxflags = output(&mut cmd);
172172
let mut cfg = cc::Build::new();
173173
cfg.warnings(false);
174+
175+
// Prevent critical warnings when we're compiling from rust-lang/rust CI
176+
if std::env::var_os("CI").is_some() && !target.contains("msvc") {
177+
cfg.warnings_into_errors(true);
178+
}
174179
for flag in cxxflags.split_whitespace() {
175180
// Ignore flags like `-m64` when we're doing a cross build
176181
if is_crossed && flag.starts_with("-m") {

0 commit comments

Comments
 (0)