升级
This commit is contained in:
+100
@@ -0,0 +1,100 @@
|
||||
param(
|
||||
[string]$DatovizBuildDirectory,
|
||||
[string]$CTestExecutable = 'ctest',
|
||||
[ValidateSet('Debug', 'Release', 'RelWithDebInfo', 'MinSizeRel')]
|
||||
[string]$BuildType = 'Debug',
|
||||
[string]$Toolchain = 'vs2022'
|
||||
)
|
||||
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
$render3DRoot = $PSScriptRoot
|
||||
$workspaceRoot = Split-Path -Parent $render3DRoot
|
||||
$aeRoot = Split-Path -Parent (Split-Path -Parent $workspaceRoot)
|
||||
$cacheVariant = "${Toolchain}_${BuildType}"
|
||||
$pthreadsRuntimeDirectory = Join-Path $aeRoot "cached_external_library\${cacheVariant}_render_3D\install\PThreads4W\x86_64\${BuildType}\bin"
|
||||
$oneTBBRuntimeDirectory = Join-Path $aeRoot "cached_external_library\${cacheVariant}_render_kernel\install\oneTBB\bin"
|
||||
$windowsSdkRuntimeDirectory = 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.26100.0\x64'
|
||||
$runtimeDirectories = @(
|
||||
$pthreadsRuntimeDirectory
|
||||
$oneTBBRuntimeDirectory
|
||||
$windowsSdkRuntimeDirectory
|
||||
)
|
||||
|
||||
$vulkanSdkRoot = if ($env:VULKAN_SDK) {
|
||||
$env:VULKAN_SDK
|
||||
} else {
|
||||
'C:\VulkanSDK\1.4.357.0'
|
||||
}
|
||||
$runtimeDirectories += Join-Path $vulkanSdkRoot 'Bin'
|
||||
$pthreadRuntimeName = if ($BuildType -eq 'Debug') { 'pthreadVC3d.dll' } else { 'pthreadVC3.dll' }
|
||||
$oneTBBRuntimeName = if ($BuildType -eq 'Debug') { 'tbb12_debug.dll' } else { 'tbb12.dll' }
|
||||
$shadercRuntimeLibrary = Join-Path $vulkanSdkRoot 'Bin\shaderc_shared.dll'
|
||||
$runtimeLibraries = @(
|
||||
(Join-Path $pthreadsRuntimeDirectory $pthreadRuntimeName)
|
||||
(Join-Path $oneTBBRuntimeDirectory $oneTBBRuntimeName)
|
||||
$shadercRuntimeLibrary
|
||||
)
|
||||
$linkDirectories = @(
|
||||
'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.44.35207\lib\x64'
|
||||
'C:\Program Files (x86)\Windows Kits\10\Lib\10.0.26100.0\ucrt\x64'
|
||||
'C:\Program Files (x86)\Windows Kits\10\Lib\10.0.26100.0\um\x64'
|
||||
)
|
||||
|
||||
$missingDirectories = @($runtimeDirectories | Where-Object { -not (Test-Path -LiteralPath $_ -PathType Container) })
|
||||
if ($missingDirectories.Count -ne 0) {
|
||||
throw "Renderive 3D runtime directories are missing: $($missingDirectories -join ', ')"
|
||||
}
|
||||
$missingLibraries = @($runtimeLibraries | Where-Object { -not (Test-Path -LiteralPath $_ -PathType Leaf) })
|
||||
if ($missingLibraries.Count -ne 0) {
|
||||
throw "Renderive 3D runtime libraries are missing: $($missingLibraries -join ', ')"
|
||||
}
|
||||
$missingLinkDirectories = @($linkDirectories | Where-Object { -not (Test-Path -LiteralPath $_ -PathType Container) })
|
||||
if ($missingLinkDirectories.Count -ne 0) {
|
||||
throw "Renderive 3D link directories are missing: $($missingLinkDirectories -join ', ')"
|
||||
}
|
||||
|
||||
$pathEntries = @($env:PATH -split ';' | Where-Object { $_ })
|
||||
foreach ($runtimeDirectory in $runtimeDirectories) {
|
||||
if ($pathEntries -notcontains $runtimeDirectory) {
|
||||
$pathEntries = @($runtimeDirectory) + $pathEntries
|
||||
}
|
||||
}
|
||||
$env:PATH = $pathEntries -join ';'
|
||||
|
||||
$libEntries = @($env:LIB -split ';' | Where-Object { $_ })
|
||||
foreach ($linkDirectory in $linkDirectories) {
|
||||
if ($libEntries -notcontains $linkDirectory) {
|
||||
$libEntries = @($linkDirectory) + $libEntries
|
||||
}
|
||||
}
|
||||
$env:LIB = $libEntries -join ';'
|
||||
|
||||
$env:VULKAN_SDK = $vulkanSdkRoot
|
||||
$env:DVZ_SHADERC_RUNTIME_LIBRARY = $shadercRuntimeLibrary
|
||||
$env:DVZ_WHEEL_RUNTIME_DIRS = Join-Path $vulkanSdkRoot 'Bin'
|
||||
|
||||
# Datoviz's upstream tests use POSIX-style absolute /tmp paths. On Windows those paths resolve
|
||||
# against the current drive root, so prepare the equivalent directory on the workspace drive.
|
||||
$windowsTempDirectory = Join-Path ([System.IO.Path]::GetPathRoot($workspaceRoot)) 'tmp'
|
||||
New-Item -ItemType Directory -Path $windowsTempDirectory -Force | Out-Null
|
||||
$env:TMPDIR = $windowsTempDirectory
|
||||
$env:TEMP = $windowsTempDirectory
|
||||
$env:TMP = $windowsTempDirectory
|
||||
|
||||
Write-Host 'Renderive render_3D runtime environment is ready.'
|
||||
Write-Host " PThreads4W: $pthreadsRuntimeDirectory"
|
||||
Write-Host " oneTBB: $oneTBBRuntimeDirectory"
|
||||
Write-Host " Windows SDK: $windowsSdkRuntimeDirectory"
|
||||
Write-Host " Link roots: $($linkDirectories -join '; ')"
|
||||
Write-Host " Vulkan SDK: $vulkanSdkRoot"
|
||||
Write-Host " shaderc: $env:DVZ_SHADERC_RUNTIME_LIBRARY"
|
||||
Write-Host " TEMP: $windowsTempDirectory"
|
||||
|
||||
if ($DatovizBuildDirectory) {
|
||||
$resolvedBuildDirectory = (Resolve-Path -LiteralPath $DatovizBuildDirectory).Path
|
||||
& $CTestExecutable --test-dir $resolvedBuildDirectory -L datoviz --output-on-failure -j 1
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
exit $LASTEXITCODE
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user