Skip to content

Commit 8271991

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 915e535 commit 8271991

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
@@ -167,6 +167,11 @@ fn main() {
167167
let cxxflags = output(&mut cmd);
168168
let mut cfg = cc::Build::new();
169169
cfg.warnings(false);
170+
171+
// Prevent critical warnings when we're compiling from rust-lang/rust CI
172+
if std::env::var_os("CI").is_some() {
173+
cfg.warnings_into_errors(true);
174+
}
170175
for flag in cxxflags.split_whitespace() {
171176
// Ignore flags like `-m64` when we're doing a cross build
172177
if is_crossed && flag.starts_with("-m") {

0 commit comments

Comments
 (0)