@@ -17,6 +17,7 @@ use std::process::Command;
17
17
18
18
use build_helper:: { output, t} ;
19
19
20
+ use crate :: cache:: INTERNER ;
20
21
use crate :: config:: Target ;
21
22
use crate :: Build ;
22
23
@@ -79,18 +80,19 @@ pub fn check(build: &mut Build) {
79
80
}
80
81
81
82
// We need cmake, but only if we're actually building LLVM or sanitizers.
82
- let building_llvm = build
83
- . hosts
84
- . iter ( )
85
- . map ( |host| {
86
- build
87
- . config
88
- . target_config
89
- . get ( host)
90
- . map ( |config| config. llvm_config . is_none ( ) )
91
- . unwrap_or ( true )
92
- } )
93
- . any ( |build_llvm_ourselves| build_llvm_ourselves) ;
83
+ let building_llvm = build. config . rust_codegen_backends . contains ( & INTERNER . intern_str ( "llvm" ) )
84
+ && build
85
+ . hosts
86
+ . iter ( )
87
+ . map ( |host| {
88
+ build
89
+ . config
90
+ . target_config
91
+ . get ( host)
92
+ . map ( |config| config. llvm_config . is_none ( ) )
93
+ . unwrap_or ( true )
94
+ } )
95
+ . any ( |build_llvm_ourselves| build_llvm_ourselves) ;
94
96
if building_llvm || build. config . any_sanitizers_enabled ( ) {
95
97
cmd_finder. must_have ( "cmake" ) ;
96
98
}
@@ -147,10 +149,12 @@ pub fn check(build: &mut Build) {
147
149
}
148
150
}
149
151
150
- // Externally configured LLVM requires FileCheck to exist
151
- let filecheck = build. llvm_filecheck ( build. build ) ;
152
- if !filecheck. starts_with ( & build. out ) && !filecheck. exists ( ) && build. config . codegen_tests {
153
- panic ! ( "FileCheck executable {:?} does not exist" , filecheck) ;
152
+ if build. config . rust_codegen_backends . contains ( & INTERNER . intern_str ( "llvm" ) ) {
153
+ // Externally configured LLVM requires FileCheck to exist
154
+ let filecheck = build. llvm_filecheck ( build. build ) ;
155
+ if !filecheck. starts_with ( & build. out ) && !filecheck. exists ( ) && build. config . codegen_tests {
156
+ panic ! ( "FileCheck executable {:?} does not exist" , filecheck) ;
157
+ }
154
158
}
155
159
156
160
for target in & build. targets {
0 commit comments