Kokoro: fix Windows builds to correctly use %BUILD_TYPE%

CMake's CMAKE_BUILD_TYPE variable is ignored for multi-config generators,like Visual Studio. Instead, we must specify the config when building. For VulkanTester, needed to add "RelWithDebInfo" to search paths for vk_swiftshader.dll as that's the "Release" config we use for Kokoro builds. Change-Id: I1fbfa3b179e9364462f4ea6e9704120d3a675b4d Bug: b/181019484 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/53188 Kokoro-Result: kokoro <noreply+kokoro@google.com> Kokoro-Result: Antonio Maiorano <amaiorano@google.com> Commit-Queue: Antonio Maiorano <amaiorano@google.com> Tested-by: 's avatarAntonio Maiorano <amaiorano@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
parent d6f3132e
...@@ -168,10 +168,12 @@ std::vector<const char *> getDriverPaths() ...@@ -168,10 +168,12 @@ std::vector<const char *> getDriverPaths()
# if defined(_WIN64) # if defined(_WIN64)
return { "./build/Release_x64/vk_swiftshader.dll", return { "./build/Release_x64/vk_swiftshader.dll",
"./build/Release/vk_swiftshader.dll", "./build/Release/vk_swiftshader.dll",
"./build/RelWithDebInfo/vk_swiftshader.dll",
"./vk_swiftshader.dll" }; "./vk_swiftshader.dll" };
# else # else
return { "./build/Release_Win32/vk_swiftshader.dll", return { "./build/Release_Win32/vk_swiftshader.dll",
"./build/Release/vk_swiftshader.dll", "./build/Release/vk_swiftshader.dll",
"./build/RelWithDebInfo/vk_swiftshader.dll",
"./vk_swiftshader.dll" }; "./vk_swiftshader.dll" };
# endif # endif
# else # else
......
...@@ -21,47 +21,46 @@ cmake --version ...@@ -21,47 +21,46 @@ cmake --version
cmake .. ^ cmake .. ^
-G "%CMAKE_GENERATOR_TYPE%" ^ -G "%CMAKE_GENERATOR_TYPE%" ^
-Thost=x64 ^ -Thost=x64 ^
"-DCMAKE_BUILD_TYPE=%BUILD_TYPE%" ^
"-DREACTOR_BACKEND=%REACTOR_BACKEND%" ^ "-DREACTOR_BACKEND=%REACTOR_BACKEND%" ^
"-DSWIFTSHADER_LLVM_VERSION=%LLVM_VERSION%" ^ "-DSWIFTSHADER_LLVM_VERSION=%LLVM_VERSION%" ^
"-DREACTOR_VERIFY_LLVM_IR=1" ^ "-DREACTOR_VERIFY_LLVM_IR=1" ^
"-DLESS_DEBUG_INFO=%LESS_DEBUG_INFO%" || goto :error "-DLESS_DEBUG_INFO=%LESS_DEBUG_INFO%" || goto :error
cmake --build . || goto :error cmake --build . --config %BUILD_TYPE% || goto :error
REM Run the unit tests. Some must be run from project root REM Run the unit tests. Some must be run from project root
cd %SRC% || goto :error cd %SRC% || goto :error
SET SWIFTSHADER_DISABLE_DEBUGGER_WAIT_DIALOG=1 SET SWIFTSHADER_DISABLE_DEBUGGER_WAIT_DIALOG=1
build\Debug\ReactorUnitTests.exe || goto :error build\%BUILD_TYPE%\ReactorUnitTests.exe || goto :error
build\Debug\gles-unittests.exe || goto :error build\%BUILD_TYPE%\gles-unittests.exe || goto :error
build\Debug\system-unittests.exe || goto :error build\%BUILD_TYPE%\system-unittests.exe || goto :error
build\Debug\vk-unittests.exe || goto :error build\%BUILD_TYPE%\vk-unittests.exe || goto :error
REM Incrementally build and run rr::Print unit tests REM Incrementally build and run rr::Print unit tests
cd %SRC%\build || goto :error cd %SRC%\build || goto :error
cmake "-DREACTOR_ENABLE_PRINT=1" .. || goto :error cmake "-DREACTOR_ENABLE_PRINT=1" .. || goto :error
cmake --build . --target ReactorUnitTests || goto :error cmake --build . --config %BUILD_TYPE% --target ReactorUnitTests || goto :error
Debug\ReactorUnitTests.exe --gtest_filter=ReactorUnitTests.Print* || goto :error %BUILD_TYPE%\ReactorUnitTests.exe --gtest_filter=ReactorUnitTests.Print* || goto :error
cmake "-DREACTOR_ENABLE_PRINT=0" .. || goto :error cmake "-DREACTOR_ENABLE_PRINT=0" .. || goto :error
REM Incrementally build with REACTOR_EMIT_ASM_FILE and run unit test REM Incrementally build with REACTOR_EMIT_ASM_FILE and run unit test
cd %SRC%\build || goto :error cd %SRC%\build || goto :error
cmake "-DREACTOR_EMIT_ASM_FILE=1" .. || goto :error cmake "-DREACTOR_EMIT_ASM_FILE=1" .. || goto :error
cmake --build . --target ReactorUnitTests || goto :error cmake --build . --config %BUILD_TYPE% --target ReactorUnitTests || goto :error
Debug\ReactorUnitTests.exe --gtest_filter=ReactorUnitTests.EmitAsm || goto :error %BUILD_TYPE%\ReactorUnitTests.exe --gtest_filter=ReactorUnitTests.EmitAsm || goto :error
cmake "-DREACTOR_EMIT_ASM_FILE=0" .. || goto :error cmake "-DREACTOR_EMIT_ASM_FILE=0" .. || goto :error
REM Incrementally build with REACTOR_EMIT_DEBUG_INFO to ensure it builds REM Incrementally build with REACTOR_EMIT_DEBUG_INFO to ensure it builds
cd %SRC%\build || goto :error cd %SRC%\build || goto :error
cmake "-DREACTOR_EMIT_DEBUG_INFO=1" .. || goto :error cmake "-DREACTOR_EMIT_DEBUG_INFO=1" .. || goto :error
cmake --build . --target ReactorUnitTests || goto :error cmake --build . --config %BUILD_TYPE% --target ReactorUnitTests || goto :error
cmake "-DREACTOR_EMIT_DEBUG_INFO=0" .. || goto :error cmake "-DREACTOR_EMIT_DEBUG_INFO=0" .. || goto :error
REM Incrementally build with REACTOR_EMIT_PRINT_LOCATION to ensure it builds REM Incrementally build with REACTOR_EMIT_PRINT_LOCATION to ensure it builds
cd %SRC%\build || goto :error cd %SRC%\build || goto :error
cmake "-DREACTOR_EMIT_PRINT_LOCATION=1" .. || goto :error cmake "-DREACTOR_EMIT_PRINT_LOCATION=1" .. || goto :error
cmake --build . --target ReactorUnitTests || goto :error cmake --build . --config %BUILD_TYPE% --target ReactorUnitTests || goto :error
cmake "-DREACTOR_EMIT_PRINT_LOCATION=0" .. || goto :error cmake "-DREACTOR_EMIT_PRINT_LOCATION=0" .. || goto :error
exit /b 0 exit /b 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment