@@ -2328,38 +2328,39 @@ function Build-LLVM([Hashtable] $Platform) {
23282328 }
23292329}
23302330
2331- function Build-Sanitizers ([Hashtable ] $Platform ) {
2332- $LLVMTargetCache = $ (Get-ProjectBinaryCache $Platform LLVM)
2333- $LITVersionStr = $ (Invoke-Program $ (Get-PythonExecutable ) " $LLVMTargetCache \bin\llvm-lit.py" -- version)
2331+ function Build-CompilerRuntime ([Hashtable ] $Platform ) {
2332+ $LLVMBinaryCache = $ (Get-ProjectBinaryCache $Platform LLVM)
2333+
2334+ $LITVersionStr = $ (Invoke-Program $ (Get-PythonExecutable ) " $LLVMBinaryCache \bin\llvm-lit.py" -- version)
23342335 if (-not $ToBatch -and -not ($LITVersionStr -match " lit (\d+)\.\d+\.\d+.*" )) {
23352336 throw " Unexpected version string '$LITVersionStr ' output from llvm-lit.py"
23362337 }
23372338 $LLVMVersionMajor = $Matches.1
2338- $InstallTo = " $ ( $HostPlatform .ToolchainInstallRoot ) \usr\lib\clang\ $LLVMVersionMajor "
2339- Write-Host " Sanitizers SDK directory: $InstallTo "
2339+
2340+ $InstallRoot = " $ ( $HostPlatform .ToolchainInstallRoot ) \usr\lib\clang\ $LLVMVersionMajor "
23402341
23412342 Build-CMakeProject `
23422343 - Src $SourceCache \llvm- project\compiler- rt\lib\builtins `
23432344 - Bin " $ ( Get-ProjectBinaryCache $Platform ClangBuiltins) " `
2344- - InstallTo $InstallTo `
2345+ - InstallTo $InstallRoot `
23452346 - Platform $Platform `
23462347 - UseBuiltCompilers ASM, C, CXX `
23472348 - BuildTargets " install-compiler-rt" `
2348- - Defines ( @ {
2349- LLVM_DIR = " $LLVMTargetCache \lib\cmake\llvm" ;
2349+ - Defines @ {
2350+ LLVM_DIR = " $LLVMBinaryCache \lib\cmake\llvm" ;
23502351 LLVM_ENABLE_PER_TARGET_RUNTIME_DIR = " YES" ;
23512352 COMPILER_RT_DEFAULT_TARGET_ONLY = " YES" ;
2352- })
2353+ }
23532354
23542355 Build-CMakeProject `
23552356 - Src $SourceCache \llvm- project\compiler- rt `
23562357 - Bin " $ ( Get-ProjectBinaryCache $Platform ClangRuntime) " `
2357- - InstallTo $InstallTo `
2358+ - InstallTo $InstallRoot `
23582359 - Platform $Platform `
23592360 - UseBuiltCompilers ASM, C, CXX `
23602361 - BuildTargets " install-compiler-rt" `
23612362 - Defines @ {
2362- LLVM_DIR = " $LLVMTargetCache \lib\cmake\llvm" ;
2363+ LLVM_DIR = " $LLVMBinaryCache \lib\cmake\llvm" ;
23632364 LLVM_ENABLE_PER_TARGET_RUNTIME_DIR = " YES" ;
23642365 COMPILER_RT_DEFAULT_TARGET_ONLY = " YES" ;
23652366 COMPILER_RT_BUILD_BUILTINS = " NO" ;
@@ -3106,7 +3107,7 @@ function Build-SDK([Hashtable] $Platform) {
31063107 Invoke-BuildStep Build-Runtime $Platform
31073108 Invoke-BuildStep Build-Dispatch $Platform
31083109 Invoke-BuildStep Build-Foundation $Platform
3109- Invoke-BuildStep Build-Sanitizers $Platform
3110+ Invoke-BuildStep Build-CompilerRuntime $Platform
31103111 Invoke-BuildStep Build-XCTest $Platform
31113112 Invoke-BuildStep Build-Testing $Platform
31123113}
0 commit comments