File tree 1 file changed +15
-9
lines changed
src/bootstrap/src/core/build_steps
1 file changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -823,19 +823,25 @@ impl Step for LibcxxVersionTool {
823
823
824
824
fn run ( self , builder : & Builder < ' _ > ) -> LibcxxVersion {
825
825
let out_dir = builder. out . join ( self . target . to_string ( ) ) . join ( "libcxx-version" ) ;
826
- let _ = fs:: remove_dir_all ( & out_dir) ;
827
- t ! ( fs:: create_dir_all( & out_dir) ) ;
826
+ let executable = out_dir. join ( exe ( "libcxx-version" , self . target ) ) ;
828
827
829
- let compiler = builder. cxx ( self . target ) . unwrap ( ) ;
830
- let mut cmd = Command :: new ( compiler) ;
828
+ if !executable. exists ( ) {
829
+ if !out_dir. exists ( ) {
830
+ t ! ( fs:: create_dir_all( & out_dir) ) ;
831
+ }
831
832
832
- let executable = out_dir . join ( exe ( "libcxx-version" , self . target ) ) ;
833
- cmd. arg ( "-o" ) . arg ( & executable ) . arg ( builder . src . join ( "src/tools/libcxx-version/main.cpp" ) ) ;
833
+ let compiler = builder . cxx ( self . target ) . unwrap ( ) ;
834
+ let mut cmd = Command :: new ( compiler ) ;
834
835
835
- builder. run_cmd ( & mut cmd) ;
836
+ cmd. arg ( "-o" )
837
+ . arg ( & executable)
838
+ . arg ( builder. src . join ( "src/tools/libcxx-version/main.cpp" ) ) ;
836
839
837
- if !executable. exists ( ) {
838
- panic ! ( "Something went wrong. {} is not present" , executable. display( ) ) ;
840
+ builder. run_cmd ( & mut cmd) ;
841
+
842
+ if !executable. exists ( ) {
843
+ panic ! ( "Something went wrong. {} is not present" , executable. display( ) ) ;
844
+ }
839
845
}
840
846
841
847
let version_output = output ( & mut Command :: new ( executable) ) ;
You can’t perform that action at this time.
0 commit comments