mirror of
https://gitee.com/openharmony/third_party_mesa3d
synced 2024-11-27 01:20:36 +00:00
ci/vs2019: Add a dedicated script for entering VS dev shell
Then we can remove cmd.exe invocations, and spread those configure commands over multiple lines since they're not strings anymore. Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Reviewed-by: Jesse Natalie <jenatali@microsoft.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16934>
This commit is contained in:
parent
24e177aff2
commit
a740b8430a
@ -12,6 +12,7 @@ SHELL ["pwsh", "-ExecutionPolicy", "RemoteSigned", "-Command", "$ErrorActionPref
|
||||
|
||||
COPY mesa_deps_vs2019.ps1 C:\
|
||||
RUN C:\mesa_deps_vs2019.ps1
|
||||
COPY mesa_vs_init.ps1 C:\
|
||||
|
||||
ENV VULKAN_SDK_VERSION='1.3.211.0'
|
||||
COPY mesa_deps_build.ps1 C:\
|
||||
|
@ -26,12 +26,8 @@ Write-Output builddir:$builddir
|
||||
Write-Output installdir:$installdir
|
||||
Write-Output sourcedir:$sourcedir
|
||||
|
||||
$vsInstallPath=& "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -version 16.0 -property installationpath
|
||||
Write-Output "vswhere.exe installPath: $vsInstallPath"
|
||||
$vsInstallPath = if ("$vsInstallPath" -eq "" ) { "C:\BuildTools" } else { "$vsInstallPath" }
|
||||
Write-Output "Final installPath: $vsInstallPath"
|
||||
Import-Module (Join-Path $vsInstallPath "Common7\Tools\Microsoft.VisualStudio.DevShell.dll")
|
||||
Enter-VsDevShell -VsInstallPath $vsInstallPath -SkipAutomaticLocation -DevCmdArguments '-arch=x64 -no_logo -host_arch=amd64'
|
||||
$MyPath = $MyInvocation.MyCommand.Path | Split-Path -Parent
|
||||
. "$MyPath\mesa_vs_init.ps1"
|
||||
|
||||
Push-Location $builddir
|
||||
|
||||
|
@ -59,6 +59,9 @@ if (!$?) {
|
||||
Exit 1
|
||||
}
|
||||
|
||||
$MyPath = $MyInvocation.MyCommand.Path | Split-Path -Parent
|
||||
. "$MyPath\mesa_vs_init.ps1"
|
||||
|
||||
# we want more secure TLS 1.2 for most things, but it breaks SourceForge
|
||||
# downloads so must be done after Chocolatey use
|
||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 -bor [Net.SecurityProtocolType]::Tls13;
|
||||
@ -90,7 +93,27 @@ Get-Date
|
||||
$llvm_build = New-Item -ItemType Directory -ErrorAction SilentlyContinue -Force -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=AMDGPU;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 -Wno-dev && ninja -j32 install'
|
||||
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="AMDGPU;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 `
|
||||
-Wno-dev && `
|
||||
ninja -j32 install
|
||||
$buildstatus = $?
|
||||
Pop-Location
|
||||
if (!$buildstatus) {
|
||||
@ -103,7 +126,15 @@ $libclc_build = New-Item -ItemType Directory -Path ".\llvm-project" -Name "build
|
||||
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_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 -j32 install'
|
||||
cmake ../libclc `
|
||||
-GNinja `
|
||||
-DCMAKE_BUILD_TYPE=Release `
|
||||
-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 -j32 install
|
||||
$buildstatus = $?
|
||||
Pop-Location
|
||||
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue -Path $libclc_build
|
||||
@ -129,7 +160,13 @@ 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 -j32 install'
|
||||
cmake .. `
|
||||
-GNinja `
|
||||
-DCMAKE_BUILD_TYPE=Release `
|
||||
-DCMAKE_POLICY_DEFAULT_CMP0091=NEW `
|
||||
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded `
|
||||
-DCMAKE_INSTALL_PREFIX="C:\spirv-tools" && `
|
||||
ninja -j32 install
|
||||
$buildstatus = $?
|
||||
Pop-Location
|
||||
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue -Path $spv_build
|
||||
|
@ -25,6 +25,9 @@ if (!$?) {
|
||||
Exit 1
|
||||
}
|
||||
|
||||
$MyPath = $MyInvocation.MyCommand.Path | Split-Path -Parent
|
||||
. "$MyPath\mesa_vs_init.ps1"
|
||||
|
||||
Get-Date
|
||||
Write-Host "Downloading glext.h"
|
||||
New-Item -ItemType Directory -Path ".\glext" -Name "GL"
|
||||
@ -46,7 +49,14 @@ Get-Date
|
||||
$piglit_build = New-Item -ItemType Directory -Path "C:\src\piglit" -Name "build"
|
||||
Push-Location -Path $piglit_build.FullName
|
||||
Write-Host "Compiling Piglit"
|
||||
cmd.exe /C 'C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=amd64 && cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="C:\Piglit" -DGLUT_INCLUDE_DIR=C:\freeglut\include -DGLUT_glut_LIBRARY_RELEASE=C:\freeglut\lib\x64\freeglut.lib -DGLEXT_INCLUDE_DIR=.\glext && ninja -j32'
|
||||
cmake .. `
|
||||
-GNinja `
|
||||
-DCMAKE_BUILD_TYPE=Release `
|
||||
-DCMAKE_INSTALL_PREFIX="C:\Piglit" `
|
||||
-DGLUT_INCLUDE_DIR=C:\freeglut\include `
|
||||
-DGLUT_glut_LIBRARY_RELEASE=C:\freeglut\lib\x64\freeglut.lib `
|
||||
-DGLEXT_INCLUDE_DIR=.\glext && `
|
||||
ninja -j32
|
||||
$buildstatus = $?
|
||||
ninja -j32 install | Out-Null
|
||||
$installstatus = $?
|
||||
@ -86,7 +96,12 @@ Get-Date
|
||||
$deqp_build = New-Item -ItemType Directory -Path "C:\deqp"
|
||||
Push-Location -Path $deqp_build.FullName
|
||||
Write-Host "Compiling deqp"
|
||||
cmd.exe /C "C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=amd64 && cmake -S $($deqp_source) -B . -GNinja -DCMAKE_BUILD_TYPE=Release -DDEQP_TARGET=default && ninja -j32"
|
||||
cmake -S $($deqp_source) `
|
||||
-B . `
|
||||
-GNinja `
|
||||
-DCMAKE_BUILD_TYPE=Release `
|
||||
-DDEQP_TARGET=default && `
|
||||
ninja -j32
|
||||
$buildstatus = $?
|
||||
Pop-Location
|
||||
if (!$buildstatus -Or !$installstatus) {
|
||||
|
11
.gitlab-ci/windows/mesa_vs_init.ps1
Normal file
11
.gitlab-ci/windows/mesa_vs_init.ps1
Normal file
@ -0,0 +1,11 @@
|
||||
$vsInstallPath=& "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -version 16.0 -property installationpath
|
||||
Write-Output "vswhere.exe installPath: $vsInstallPath"
|
||||
$vsInstallPath = if ("$vsInstallPath" -eq "" ) { "C:\BuildTools" } else { "$vsInstallPath" }
|
||||
Write-Output "Final installPath: $vsInstallPath"
|
||||
Import-Module (Join-Path $vsInstallPath "Common7\Tools\Microsoft.VisualStudio.DevShell.dll")
|
||||
# https://en.wikipedia.org/wiki/Microsoft_Visual_C%2B%2B
|
||||
# VS2015 14.0
|
||||
# VS2017 14.16
|
||||
# VS2019 14.29
|
||||
# VS2022 14.32
|
||||
Enter-VsDevShell -VsInstallPath $vsInstallPath -SkipAutomaticLocation -DevCmdArguments '-vcvars_ver=14.29 -arch=x64 -no_logo -host_arch=amd64'
|
Loading…
Reference in New Issue
Block a user