diff options
author | Daniel Stone <daniels@collabora.com> | 2020-11-26 17:47:38 +0000 |
---|---|---|
committer | Erik Faye-Lund <erik.faye-lund@collabora.com> | 2020-11-27 11:22:07 +0000 |
commit | ddc900f7384c247185ca572e572aac8bd4748d06 (patch) | |
tree | bf45721f04bce338ce86b7b12998e82b6723e469 /.gitlab-ci/windows | |
parent | ad90e9fee6ea2c7bf05104a589d60e9368f5427e (diff) | |
download | mesa-ddc900f7384c247185ca572e572aac8bd4748d06.tar.gz |
CI: Add Windows libclc and SPIRV-LLVM-Translator builds
We need these builds in Windows in order to build the microsoft-clc
parts.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7537>
Diffstat (limited to '.gitlab-ci/windows')
-rw-r--r-- | .gitlab-ci/windows/mesa_deps.ps1 | 55 |
1 files changed, 51 insertions, 4 deletions
diff --git a/.gitlab-ci/windows/mesa_deps.ps1 b/.gitlab-ci/windows/mesa_deps.ps1 index 7fa52ad0053..2b2ab591a1f 100644 --- a/.gitlab-ci/windows/mesa_deps.ps1 +++ b/.gitlab-ci/windows/mesa_deps.ps1 @@ -60,26 +60,73 @@ if (!$?) { Remove-Item C:\vs_buildtools.exe -Force Get-Date -Write-Host "Cloning LLVM 10.x" -git clone -b release/10.x --depth=1 https://github.com/llvm/llvm-project llvm-project +Write-Host "Cloning LLVM master" +git clone -b master --depth=1 https://github.com/llvm/llvm-project llvm-project if (!$?) { Write-Host "Failed to clone LLVM repository" Exit 1 } Get-Date +Write-Host "Cloning SPIRV-LLVM-Translator" +git clone -b master https://github.com/KhronosGroup/SPIRV-LLVM-Translator llvm-project/llvm/projects/SPIRV-LLVM-Translator +if (!$?) { + Write-Host "Failed to clone SPIRV-LLVM-Translator repository" + Exit 1 +} + +Get-Date # slightly convoluted syntax but avoids the CWD being under the PS filesystem meta-path $llvm_build = New-Item -ItemType Directory -Path ".\llvm-project" -Name "build" Push-Location -Path $llvm_build.FullName Write-Host "Compiling LLVM and Clang" -cmd.exe /C 'C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=amd64 && cmake ../llvm -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_USE_CRT_RELEASE=MT -DCMAKE_INSTALL_PREFIX="C:\llvm-10" -DLLVM_ENABLE_PROJECTS="clang;lld" -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_OPTIMIZED_TABLEGEN=TRUE -DLLVM_ENABLE_ASSERTIONS=TRUE -DLLVM_INCLUDE_UTILS=OFF -DLLVM_INCLUDE_RUNTIMES=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_GO_TESTS=OFF -DLLVM_INCLUDE_BENCHMARKS=OFF -DLLVM_BUILD_LLVM_C_DYLIB=OFF -DLLVM_ENABLE_DIA_SDK=OFF -DCLANG_BUILD_TOOLS=ON && ninja -j4 install' +cmd.exe /C 'C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=amd64 && cmake ../llvm -GNinja -DCMAKE_BUILD_TYPE=Release -DLLVM_USE_CRT_RELEASE=MT -DCMAKE_INSTALL_PREFIX="C:\llvm-10" -DLLVM_ENABLE_PROJECTS="clang;lld" -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_OPTIMIZED_TABLEGEN=TRUE -DLLVM_ENABLE_ASSERTIONS=TRUE -DLLVM_INCLUDE_UTILS=OFF -DLLVM_INCLUDE_RUNTIMES=OFF -DLLVM_INCLUDE_TESTS=OFF -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_GO_TESTS=OFF -DLLVM_INCLUDE_BENCHMARKS=OFF -DLLVM_BUILD_LLVM_C_DYLIB=OFF -DLLVM_ENABLE_DIA_SDK=OFF -DCLANG_BUILD_TOOLS=ON -DLLVM_SPIRV_INCLUDE_TESTS=OFF && ninja -j4 install' $buildstatus = $? Pop-Location -Remove-Item -Recurse -Path $llvm_build if (!$buildstatus) { Write-Host "Failed to compile LLVM" Exit 1 } Get-Date +$libclc_build = New-Item -ItemType Directory -Path ".\llvm-project" -Name "build-libclc" +Push-Location -Path $libclc_build.FullName +Write-Host "Compiling libclc" +# libclc can only be built with Ninja, because CMake's VS backend doesn't know how to compile new language types +cmd.exe /C 'C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=amd64 && cmake ../libclc -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER="/llvm-10/bin/clang-cl.exe" -DCMAKE_CXX_FLAGS="-m64" -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DCMAKE_INSTALL_PREFIX="C:\llvm-10" -DLIBCLC_TARGETS_TO_BUILD="spirv-mesa3d-;spirv64-mesa3d-" && ninja -j4 install' +$buildstatus = $? +Pop-Location +Remove-Item -Recurse -Path $libclc_build +if (!$buildstatus) { + Write-Host "Failed to compile libclc" + Exit 1 +} +Remove-Item -Recurse -Path $llvm_build + +Get-Date +Write-Host "Cloning SPIRV-Tools" +git clone https://github.com/KhronosGroup/SPIRV-Tools +if (!$?) { + Write-Host "Failed to clone SPIRV-Tools repository" + Exit 1 +} +git clone https://github.com/KhronosGroup/SPIRV-Headers SPIRV-Tools/external/SPIRV-Headers +if (!$?) { + Write-Host "Failed to clone SPIRV-Headers repository" + Exit 1 +} +Write-Host "Building SPIRV-Tools" +$spv_build = New-Item -ItemType Directory -Path ".\SPIRV-Tools" -Name "build" +Push-Location -Path $spv_build.FullName +# SPIRV-Tools doesn't use multi-threaded MSVCRT, but we need it to +cmd.exe /C 'C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=amd64 && cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded -DCMAKE_INSTALL_PREFIX="C:\spirv-tools" && ninja -j4 install' +$buildstatus = $? +Pop-Location +Remove-Item -Recurse -Path $spv_build +if (!$buildstatus) { + Write-Host "Failed to compile SPIRV-Tools" + Exit 1 +} + +Get-Date Write-Host "Complete" |