File tree 1 file changed +13
-0
lines changed
src/tools/run-make-support/src
1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,12 @@ pub fn ar(inputs: &[impl AsRef<Path>], output_path: impl AsRef<Path>) {
74
74
}
75
75
}
76
76
77
+ /// Check if target is linux-like.
78
+ #[ must_use]
79
+ pub fn is_linux ( ) -> bool {
80
+ target ( ) . contains ( "linux" )
81
+ }
82
+
77
83
/// Check if target is windows-like.
78
84
#[ must_use]
79
85
pub fn is_windows ( ) -> bool {
@@ -92,6 +98,13 @@ pub fn is_darwin() -> bool {
92
98
target ( ) . contains ( "darwin" )
93
99
}
94
100
101
+ /// Check if `component` is within `LLVM_COMPONENTS`
102
+ #[ must_use]
103
+ pub fn llvm_components_contain ( component : & str ) -> bool {
104
+ // `LLVM_COMPONENTS` is a space-separated list of words
105
+ env_var ( "LLVM_COMPONENTS" ) . split_whitespace ( ) . find ( |s| s == & component) . is_some ( )
106
+ }
107
+
95
108
#[ track_caller]
96
109
#[ must_use]
97
110
pub fn python_command ( ) -> Command {
You can’t perform that action at this time.
0 commit comments