File tree 3 files changed +34
-19
lines changed
3 files changed +34
-19
lines changed Original file line number Diff line number Diff line change @@ -203,8 +203,16 @@ impl Step for Llvm {
203
203
cfg. define ( "LLVM_BUILD_32_BITS" , "ON" ) ;
204
204
}
205
205
206
+ let mut enabled_llvm_projects = Vec :: new ( ) ;
207
+
208
+ if util:: forcing_clang_based_tests ( ) {
209
+ enabled_llvm_projects. push ( "clang" ) ;
210
+ enabled_llvm_projects. push ( "compiler-rt" ) ;
211
+ }
212
+
206
213
if want_lldb {
207
- cfg. define ( "LLVM_ENABLE_PROJECTS" , "clang;lldb;compiler-rt" ) ;
214
+ enabled_llvm_projects. push ( "clang" ) ;
215
+ enabled_llvm_projects. push ( "lldb" ) ;
208
216
// For the time being, disable code signing.
209
217
cfg. define ( "LLDB_CODESIGN_IDENTITY" , "" ) ;
210
218
cfg. define ( "LLDB_NO_DEBUGSERVER" , "ON" ) ;
@@ -214,6 +222,12 @@ impl Step for Llvm {
214
222
cfg. define ( "LLVM_ENABLE_LIBXML2" , "OFF" ) ;
215
223
}
216
224
225
+ if enabled_llvm_projects. len ( ) > 0 {
226
+ enabled_llvm_projects. sort ( ) ;
227
+ enabled_llvm_projects. dedup ( ) ;
228
+ cfg. define ( "LLVM_ENABLE_PROJECTS" , enabled_llvm_projects. join ( ";" ) ) ;
229
+ }
230
+
217
231
if let Some ( num_linkers) = builder. config . llvm_link_jobs {
218
232
if num_linkers > 0 {
219
233
cfg. define ( "LLVM_PARALLEL_LINK_JOBS" , num_linkers. to_string ( ) ) ;
Original file line number Diff line number Diff line change @@ -1143,24 +1143,9 @@ impl Step for Compiletest {
1143
1143
}
1144
1144
}
1145
1145
1146
- if let Some ( var) = env:: var_os ( "RUSTBUILD_FORCE_CLANG_BASED_TESTS" ) {
1147
- match & var. to_string_lossy ( ) . to_lowercase ( ) [ ..] {
1148
- "1" | "yes" | "on" => {
1149
- assert ! ( builder. config. lldb_enabled,
1150
- "RUSTBUILD_FORCE_CLANG_BASED_TESTS needs Clang/LLDB to \
1151
- be built.") ;
1152
- let clang_exe = builder. llvm_out ( target) . join ( "bin" ) . join ( "clang" ) ;
1153
- cmd. arg ( "--run-clang-based-tests-with" ) . arg ( clang_exe) ;
1154
- }
1155
- "0" | "no" | "off" => {
1156
- // Nothing to do.
1157
- }
1158
- other => {
1159
- // Let's make sure typos don't get unnoticed
1160
- panic ! ( "Unrecognized option '{}' set in \
1161
- RUSTBUILD_FORCE_CLANG_BASED_TESTS", other) ;
1162
- }
1163
- }
1146
+ if util:: forcing_clang_based_tests ( ) {
1147
+ let clang_exe = builder. llvm_out ( target) . join ( "bin" ) . join ( "clang" ) ;
1148
+ cmd. arg ( "--run-clang-based-tests-with" ) . arg ( clang_exe) ;
1164
1149
}
1165
1150
1166
1151
// Get paths from cmd args
Original file line number Diff line number Diff line change @@ -356,3 +356,19 @@ impl CiEnv {
356
356
}
357
357
}
358
358
}
359
+
360
+ pub fn forcing_clang_based_tests ( ) -> bool {
361
+ if let Some ( var) = env:: var_os ( "RUSTBUILD_FORCE_CLANG_BASED_TESTS" ) {
362
+ match & var. to_string_lossy ( ) . to_lowercase ( ) [ ..] {
363
+ "1" | "yes" | "on" => true ,
364
+ "0" | "no" | "off" => false ,
365
+ other => {
366
+ // Let's make sure typos don't go unnoticed
367
+ panic ! ( "Unrecognized option '{}' set in \
368
+ RUSTBUILD_FORCE_CLANG_BASED_TESTS", other)
369
+ }
370
+ }
371
+ } else {
372
+ false
373
+ }
374
+ }
You can’t perform that action at this time.
0 commit comments