@@ -155,7 +155,7 @@ pub(crate) fn detect_llvm_sha(config: &Config, is_git: bool) -> String {
155
155
"" . to_owned ( )
156
156
} ;
157
157
158
- if & llvm_sha == "" {
158
+ if llvm_sha. is_empty ( ) {
159
159
eprintln ! ( "error: could not find commit hash for downloading LLVM" ) ;
160
160
eprintln ! ( "help: maybe your repository history is too shallow?" ) ;
161
161
eprintln ! ( "help: consider disabling `download-ci-llvm`" ) ;
@@ -208,10 +208,10 @@ pub(crate) fn is_ci_llvm_available(config: &Config, asserts: bool) -> bool {
208
208
( "x86_64-unknown-netbsd" , false ) ,
209
209
] ;
210
210
211
- if !supported_platforms. contains ( & ( & * config. build . triple , asserts) ) {
212
- if asserts == true || !supported_platforms. contains ( & ( & * config. build . triple , true ) ) {
213
- return false ;
214
- }
211
+ if !supported_platforms. contains ( & ( & * config. build . triple , asserts) )
212
+ && ( asserts || !supported_platforms. contains ( & ( & * config. build . triple , true ) ) )
213
+ {
214
+ return false ;
215
215
}
216
216
217
217
if is_ci_llvm_modified ( config) {
@@ -497,11 +497,11 @@ impl Step for Llvm {
497
497
let mut cmd = Command :: new ( & res. llvm_config ) ;
498
498
let version = output ( cmd. arg ( "--version" ) ) ;
499
499
let major = version. split ( '.' ) . next ( ) . unwrap ( ) ;
500
- let lib_name = match & llvm_version_suffix {
500
+
501
+ match & llvm_version_suffix {
501
502
Some ( version_suffix) => format ! ( "libLLVM-{major}{version_suffix}.{extension}" ) ,
502
503
None => format ! ( "libLLVM-{major}.{extension}" ) ,
503
- } ;
504
- lib_name
504
+ }
505
505
} ;
506
506
507
507
// When building LLVM with LLVM_LINK_LLVM_DYLIB for macOS, an unversioned
@@ -756,13 +756,15 @@ fn configure_cmake(
756
756
757
757
// For distribution we want the LLVM tools to be *statically* linked to libstdc++.
758
758
// We also do this if the user explicitly requested static libstdc++.
759
- if builder. config . llvm_static_stdcpp {
760
- if !target. contains ( "msvc" ) && !target. contains ( "netbsd" ) && !target. contains ( "solaris" ) {
761
- if target. contains ( "apple" ) || target. contains ( "windows" ) {
762
- ldflags. push_all ( "-static-libstdc++" ) ;
763
- } else {
764
- ldflags. push_all ( "-Wl,-Bsymbolic -static-libstdc++" ) ;
765
- }
759
+ if builder. config . llvm_static_stdcpp
760
+ && !target. contains ( "msvc" )
761
+ && !target. contains ( "netbsd" )
762
+ && !target. contains ( "solaris" )
763
+ {
764
+ if target. contains ( "apple" ) || target. contains ( "windows" ) {
765
+ ldflags. push_all ( "-static-libstdc++" ) ;
766
+ } else {
767
+ ldflags. push_all ( "-Wl,-Bsymbolic -static-libstdc++" ) ;
766
768
}
767
769
}
768
770
0 commit comments