Skip to content

Commit 740833e

Browse files
committed
Add llvm_components_contain to run-make-support
1 parent 5c8459f commit 740833e

File tree

1 file changed

+7
-0
lines changed
  • src/tools/run-make-support/src

1 file changed

+7
-0
lines changed

src/tools/run-make-support/src/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,13 @@ pub fn assert_not_contains(haystack: &str, needle: &str) {
429429
}
430430
}
431431

432+
/// Check that `component` is in the `LLVM_COMPONENTS` variable.
433+
pub fn llvm_components_contain(component: &str) -> bool {
434+
let llvm_components = env_var("LLVM_COMPONENTS");
435+
// llvm_components is a list of space-separated words
436+
format!(" {llvm_components} ").contains(&format!(" {component} "))
437+
}
438+
432439
/// This function is designed for running commands in a temporary directory
433440
/// that is cleared after the function ends.
434441
///

0 commit comments

Comments
 (0)