@@ -345,6 +345,18 @@ def build(self, host_target):
345
345
self .cmake_options .extend (host_config .cmake_options )
346
346
self .cmake_options .extend (llvm_cmake_options )
347
347
348
+ self ._handle_cxx_headers (host_target , platform )
349
+
350
+ self .build_with_cmake (build_targets , self .args .llvm_build_variant , [])
351
+
352
+ # copy over the compiler-rt builtins for iOS/tvOS/watchOS to ensure
353
+ # that Swift's stdlib can use compiler-rt builtins when targeting
354
+ # iOS/tvOS/watchOS.
355
+ if self .args .build_llvm and system () == 'Darwin' :
356
+ self .copy_embedded_compiler_rt_builtins_from_darwin_host_toolchain (
357
+ self .build_dir )
358
+
359
+ def _handle_cxx_headers (self , host_target , platform ):
348
360
# When we are building LLVM create symlinks to the c++ headers. We need
349
361
# to do this before building LLVM since compiler-rt depends on being
350
362
# built with the just built clang compiler. These are normally put into
@@ -386,15 +398,6 @@ def build(self, host_target):
386
398
host_cxx_headers_dir , built_cxx_include_dir ))
387
399
shell .call (['ln' , '-s' , '-f' , host_cxx_headers_dir , built_cxx_include_dir ])
388
400
389
- self .build_with_cmake (build_targets , self .args .llvm_build_variant , [])
390
-
391
- # copy over the compiler-rt builtins for iOS/tvOS/watchOS to ensure
392
- # that Swift's stdlib can use compiler-rt builtins when targeting
393
- # iOS/tvOS/watchOS.
394
- if self .args .build_llvm and system () == 'Darwin' :
395
- self .copy_embedded_compiler_rt_builtins_from_darwin_host_toolchain (
396
- self .build_dir )
397
-
398
401
def should_test (self , host_target ):
399
402
"""should_test() -> Bool
400
403
0 commit comments