@@ -148,7 +148,7 @@ pub(crate) fn detect_llvm_sha(config: &Config, is_git: bool) -> String {
148
148
"" . to_owned ( )
149
149
} ;
150
150
151
- if & llvm_sha == "" {
151
+ if llvm_sha. is_empty ( ) {
152
152
eprintln ! ( "error: could not find commit hash for downloading LLVM" ) ;
153
153
eprintln ! ( "help: maybe your repository history is too shallow?" ) ;
154
154
eprintln ! ( "help: consider disabling `download-ci-llvm`" ) ;
@@ -201,10 +201,10 @@ pub(crate) fn is_ci_llvm_available(config: &Config, asserts: bool) -> bool {
201
201
( "x86_64-unknown-netbsd" , false ) ,
202
202
] ;
203
203
204
- if !supported_platforms. contains ( & ( & * config. build . triple , asserts) ) {
205
- if asserts == true || !supported_platforms. contains ( & ( & * config. build . triple , true ) ) {
206
- return false ;
207
- }
204
+ if !supported_platforms. contains ( & ( & * config. build . triple , asserts) )
205
+ && ( asserts || !supported_platforms. contains ( & ( & * config. build . triple , true ) ) )
206
+ {
207
+ return false ;
208
208
}
209
209
210
210
if is_ci_llvm_modified ( config) {
@@ -490,11 +490,11 @@ impl Step for Llvm {
490
490
let mut cmd = Command :: new ( & res. llvm_config ) ;
491
491
let version = output ( cmd. arg ( "--version" ) ) ;
492
492
let major = version. split ( '.' ) . next ( ) . unwrap ( ) ;
493
- let lib_name = match & llvm_version_suffix {
493
+
494
+ match & llvm_version_suffix {
494
495
Some ( version_suffix) => format ! ( "libLLVM-{major}{version_suffix}.{extension}" ) ,
495
496
None => format ! ( "libLLVM-{major}.{extension}" ) ,
496
- } ;
497
- lib_name
497
+ }
498
498
} ;
499
499
500
500
// When building LLVM with LLVM_LINK_LLVM_DYLIB for macOS, an unversioned
@@ -749,13 +749,15 @@ fn configure_cmake(
749
749
750
750
// For distribution we want the LLVM tools to be *statically* linked to libstdc++.
751
751
// We also do this if the user explicitly requested static libstdc++.
752
- if builder. config . llvm_static_stdcpp {
753
- if !target. contains ( "msvc" ) && !target. contains ( "netbsd" ) && !target. contains ( "solaris" ) {
754
- if target. contains ( "apple" ) || target. contains ( "windows" ) {
755
- ldflags. push_all ( "-static-libstdc++" ) ;
756
- } else {
757
- ldflags. push_all ( "-Wl,-Bsymbolic -static-libstdc++" ) ;
758
- }
752
+ if builder. config . llvm_static_stdcpp
753
+ && !target. contains ( "msvc" )
754
+ && !target. contains ( "netbsd" )
755
+ && !target. contains ( "solaris" )
756
+ {
757
+ if target. contains ( "apple" ) || target. contains ( "windows" ) {
758
+ ldflags. push_all ( "-static-libstdc++" ) ;
759
+ } else {
760
+ ldflags. push_all ( "-Wl,-Bsymbolic -static-libstdc++" ) ;
759
761
}
760
762
}
761
763
0 commit comments