2026-01-08 20:58:25 +03:30
|
|
|
# @ref https://learn.microsoft.com/en-us/cpp/build/reference/compiler-options-listed-by-category
|
|
|
|
|
|
2026-02-02 13:27:20 +03:30
|
|
|
# @todo(Light): fetch path and uuid from environment
|
|
|
|
|
Import-Module 'C:\Program Files\Microsoft Visual Studio\18\Enterprise\Common7\Tools\Microsoft.VisualStudio.DevShell.dll'
|
|
|
|
|
Enter-VsDevShell 1a3e2aa7 -SkipAutomaticLocation -DevCmdArguments '-arch=x64 -host_arch=x64'
|
|
|
|
|
|
2026-02-02 13:43:42 +03:30
|
|
|
$env:VULKAN_SDK = "C:\VulkanSDK\1.4.335.0"
|
|
|
|
|
$env:PATH = "$env:VULKAN_SDK\Bin;$env:PATH"
|
|
|
|
|
$env:INCLUDE = "$env:VULKAN_SDK\Include;$env:INCLUDE"
|
|
|
|
|
$env:LIB = "$env:VULKAN_SDK\Lib;$env:LIB"
|
|
|
|
|
$env:LIBPATH = "$env:VULKAN_SDK\Lib;$env:LIBPATH"
|
|
|
|
|
|
2026-02-02 12:44:06 +03:30
|
|
|
if (Test-Path "./build") {
|
|
|
|
|
Remove-Item "./build" -r -force
|
|
|
|
|
}
|
|
|
|
|
|
2026-01-08 20:58:25 +03:30
|
|
|
cmake `
|
|
|
|
|
-S . `
|
|
|
|
|
-B build `
|
|
|
|
|
-G Ninja `
|
|
|
|
|
-D ENABLE_UNIT_TESTS=ON `
|
2026-02-02 12:14:57 +03:30
|
|
|
-D CMAKE_BUILD_TYPE=Debug `
|
|
|
|
|
-D CMAKE_EXPORT_COMPILE_COMMANDS=True `
|
2026-01-08 20:59:48 +03:30
|
|
|
-D CMAKE_CXX_FLAGS="/std:c++latest /EHsc /Zi /Oy- /WX /W4"
|
2026-01-08 20:58:25 +03:30
|
|
|
|
|
|
|
|
cmake --build ./build
|
2025-07-20 04:37:05 +00:00
|
|
|
|
|
|
|
|
$tests = Get-ChildItem -Path "./build" -Recurse -File | Where-Object {
|
|
|
|
|
$_.Name -like "*_tests.exe"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
foreach ($test in $tests) {
|
2026-02-02 12:14:57 +03:30
|
|
|
Write-Host ""
|
|
|
|
|
Write-Host "| $($test.BaseName) |"
|
2025-07-20 04:37:05 +00:00
|
|
|
& $test.FullName
|
|
|
|
|
if ($LASTEXITCODE -ne 0) {
|
|
|
|
|
Write-Error "Test $($test.Name) failed! T_T"
|
|
|
|
|
exit $LASTEXITCODE
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|