@@ -22,22 +22,21 @@ fn main() {
2222
2323 let target = env:: var ( "TARGET" ) . expect ( "TARGET was not set" ) ;
2424 let llvm_config = env:: var_os ( "LLVM_CONFIG" )
25- . map ( PathBuf :: from)
26- . unwrap_or_else ( || {
27- if let Some ( dir) = env:: var_os ( "CARGO_TARGET_DIR" )
28- . map ( PathBuf :: from) {
29- let to_test = dir. parent ( )
30- . unwrap ( )
31- . parent ( )
32- . unwrap ( )
33- . join ( & target)
34- . join ( "llvm/bin/llvm-config" ) ;
35- if Command :: new ( & to_test) . output ( ) . is_ok ( ) {
36- return to_test;
37- }
38- }
39- PathBuf :: from ( "llvm-config" )
40- } ) ;
25+ . map ( PathBuf :: from)
26+ . unwrap_or_else ( || {
27+ if let Some ( dir) = env:: var_os ( "CARGO_TARGET_DIR" ) . map ( PathBuf :: from) {
28+ let to_test = dir. parent ( )
29+ . unwrap ( )
30+ . parent ( )
31+ . unwrap ( )
32+ . join ( & target)
33+ . join ( "llvm/bin/llvm-config" ) ;
34+ if Command :: new ( & to_test) . output ( ) . is_ok ( ) {
35+ return to_test;
36+ }
37+ }
38+ PathBuf :: from ( "llvm-config" )
39+ } ) ;
4140
4241 println ! ( "cargo:rerun-if-changed={}" , llvm_config. display( ) ) ;
4342
@@ -66,8 +65,8 @@ fn main() {
6665 let host = env:: var ( "HOST" ) . expect ( "HOST was not set" ) ;
6766 let is_crossed = target != host;
6867
69- let optional_components = [ "x86" , "arm" , "aarch64" , "mips" , "powerpc" , "pnacl" , "systemz" ,
70- "jsbackend" ] ;
68+ let optional_components =
69+ [ "x86" , "arm" , "aarch64" , "mips" , "powerpc" , "pnacl" , "systemz" , "jsbackend" ] ;
7170
7271 // FIXME: surely we don't need all these components, right? Stuff like mcjit
7372 // or interpreter the compiler itself never uses.
@@ -149,7 +148,7 @@ fn main() {
149148 // that off
150149 lib. trim_right_matches ( ".lib" )
151150 } else {
152- continue
151+ continue ;
153152 } ;
154153
155154 // Don't need or want this library, but LLVM's CMake build system
@@ -158,7 +157,7 @@ fn main() {
158157 // library and it otherwise may just pull in extra dependencies on
159158 // libedit which we don't want
160159 if name == "LLVMLineEditor" {
161- continue
160+ continue ;
162161 }
163162
164163 let kind = if name. starts_with ( "LLVM" ) {
@@ -179,7 +178,7 @@ fn main() {
179178 cmd. arg ( "--ldflags" ) ;
180179 for lib in output ( & mut cmd) . split_whitespace ( ) {
181180 if lib. starts_with ( "-LIBPATH:" ) {
182- println ! ( "cargo:rustc-link-search=native={}" , & lib[ 9 ..] ) ;
181+ println ! ( "cargo:rustc-link-search=native={}" , & lib[ 9 ..] ) ;
183182 } else if is_crossed {
184183 if lib. starts_with ( "-L" ) {
185184 println ! ( "cargo:rustc-link-search=native={}" ,
0 commit comments