@@ -24,22 +24,10 @@ jobs:
2424 steps :
2525 - uses : actions/checkout@v3
2626
27- - name : Install LLVM 15
27+ - id : setup-llvm
28+ name : Set up LLVM (MSVC)
29+ uses : ./.github/actions/setup-llvm-msvc
2830 if : matrix.compiler == 'clang-cl'
29- run : |
30- Invoke-WebRequest "https://github.com/llvm/llvm-project/releases/download/llvmorg-15.0.2/LLVM-15.0.2-win64.exe" -OutFile LLVM-installer.exe
31- .\LLVM-installer.exe /S "/D=$pwd\LLVM" | Out-Null
32- rm LLVM-installer.exe
33- if (!(Test-Path "$pwd\LLVM\bin\clang-cl.exe")) { exit 1 }
34- Add-Content $env:GITHUB_PATH "$pwd\LLVM\bin"
35-
36- - name : Set up LLVM build tools for msbuild
37- if : matrix.compiler == 'clang-cl'
38- # Not using the LLVM tools that comes with MSVC.
39- run : |
40- Invoke-WebRequest "https://github.com/zufuliu/llvm-utils/releases/download/v22.09/LLVM_VS2017.zip" -OutFile LLVM_VS2017.zip
41- 7z x -y "LLVM_VS2017.zip" | Out-Null
42- cmd /c "LLVM_VS2017\install.bat" 1
4331
4432 - name : Download nuget
4533 run : |
6048 $target_version = "1.2.3.4"
6149 $props = "Configuration=$target_configuration,Platform=$target_platform,CppWinRTBuildVersion=$target_version"
6250 if ("${{ matrix.compiler }}" -eq "clang-cl") {
63- $props += ",Clang=1,PlatformToolset=LLVM_v143,LLVMInstallDir=$pwd\LLVM "
51+ $props += ",Clang=1,PlatformToolset=LLVM_v143,LLVMInstallDir=${{ steps.setup-llvm.outputs.llvm-path }} "
6452 }
6553 Add-Content $env:GITHUB_ENV "msbuild_config_props=/p:$props"
6654
@@ -120,22 +108,10 @@ jobs:
120108 steps :
121109 - uses : actions/checkout@v3
122110
123- - name : Install LLVM 15
111+ - id : setup-llvm
112+ name : Set up LLVM (MSVC)
113+ uses : ./.github/actions/setup-llvm-msvc
124114 if : matrix.compiler == 'clang-cl'
125- run : |
126- Invoke-WebRequest "https://github.com/llvm/llvm-project/releases/download/llvmorg-15.0.2/LLVM-15.0.2-win64.exe" -OutFile LLVM-installer.exe
127- .\LLVM-installer.exe /S "/D=$pwd\LLVM" | Out-Null
128- rm LLVM-installer.exe
129- if (!(Test-Path "$pwd\LLVM\bin\clang-cl.exe")) { exit 1 }
130- Add-Content $env:GITHUB_PATH "$pwd\LLVM\bin"
131-
132- - name : Set up LLVM build tools for msbuild
133- if : matrix.compiler == 'clang-cl'
134- run : |
135- # Not using the LLVM tools that comes with MSVC.
136- Invoke-WebRequest "https://github.com/zufuliu/llvm-utils/releases/download/v22.09/LLVM_VS2017.zip" -OutFile LLVM_VS2017.zip
137- 7z x -y "LLVM_VS2017.zip" | Out-Null
138- cmd /c "LLVM_VS2017\install.bat" 1
139115
140116 - name : Fetch cppwinrt executables
141117 if : matrix.arch != 'arm64'
@@ -170,7 +146,7 @@ jobs:
170146 $target_version = "1.2.3.4"
171147 $props = "Configuration=$target_configuration,Platform=$target_platform,CppWinRTBuildVersion=$target_version"
172148 if ("${{ matrix.compiler }}" -eq "clang-cl") {
173- $props += ",Clang=1,PlatformToolset=LLVM_v143,LLVMInstallDir=$pwd\LLVM "
149+ $props += ",Clang=1,PlatformToolset=LLVM_v143,LLVMInstallDir=${{ steps.setup-llvm.outputs.llvm-path }} "
174150 }
175151 Add-Content $env:GITHUB_ENV "msbuild_config_props=/p:$props"
176152
@@ -283,16 +259,9 @@ jobs:
283259 steps :
284260 - uses : actions/checkout@v3
285261
286- - name : Install llvm-mingw toolchain
287- run : |
288- $llvm_mingw_version = "20220906"
289- Invoke-WebRequest "https://github.com/mstorsjo/llvm-mingw/releases/download/${llvm_mingw_version}/llvm-mingw-${llvm_mingw_version}-ucrt-${{ matrix.arch }}.zip" -OutFile llvm-mingw.zip
290- 7z x llvm-mingw.zip
291- rm llvm-mingw.zip
292- if (!(Test-Path "$pwd\llvm-mingw-${llvm_mingw_version}-ucrt-${{ matrix.arch }}\bin\clang++.exe")) { return 1 }
293- Add-Content $env:GITHUB_PATH "$pwd\llvm-mingw-${llvm_mingw_version}-ucrt-${{ matrix.arch }}\bin"
294- # for the ASAN runtime DLL:
295- Add-Content $env:GITHUB_PATH "$pwd\llvm-mingw-${llvm_mingw_version}-ucrt-${{ matrix.arch }}\${{ matrix.arch }}-w64-mingw32\bin"
262+ - id : setup-llvm
263+ name : Set up llvm-mingw
264+ uses : ./.github/actions/setup-llvm-mingw
296265
297266 - name : Build cppwinrt
298267 run : |
0 commit comments