mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 06:22:00 +00:00
Add llvm_components_contain
to run-make-support
This commit is contained in:
parent
f00f850919
commit
a9e14668d6
@ -61,7 +61,7 @@ pub use env::{env_var, env_var_os};
|
||||
pub use run::{cmd, run, run_fail, run_with_args};
|
||||
|
||||
/// Helpers for checking target information.
|
||||
pub use targets::{is_darwin, is_msvc, is_windows, target, uname};
|
||||
pub use targets::{is_darwin, is_msvc, is_windows, llvm_components_contain, target, uname};
|
||||
|
||||
/// Helpers for building names of output artifacts that are potentially target-specific.
|
||||
pub use artifact_names::{
|
||||
|
@ -28,6 +28,13 @@ pub fn is_darwin() -> bool {
|
||||
target().contains("darwin")
|
||||
}
|
||||
|
||||
/// Check if `component` is within `LLVM_COMPONENTS`
|
||||
#[must_use]
|
||||
pub fn llvm_components_contain(component: &str) -> bool {
|
||||
// `LLVM_COMPONENTS` is a space-separated list of words
|
||||
env_var("LLVM_COMPONENTS").split_whitespace().find(|s| s == &component).is_some()
|
||||
}
|
||||
|
||||
/// Run `uname`. This assumes that `uname` is available on the platform!
|
||||
#[track_caller]
|
||||
#[must_use]
|
||||
|
Loading…
Reference in New Issue
Block a user