From 039770418452e63a9cf04f6a45d21c6edd179c9f Mon Sep 17 00:00:00 2001 From: "Neil R. Spruit" Date: Fri, 15 Nov 2024 13:31:49 -0800 Subject: [PATCH] Fix windows tests build and multi workflow Signed-off-by: Neil R. Spruit --- .github/workflows/build-multi-static.yml | 1 + test/CMakeLists.txt | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/.github/workflows/build-multi-static.yml b/.github/workflows/build-multi-static.yml index 0921e8ad..c510c5cd 100644 --- a/.github/workflows/build-multi-static.yml +++ b/.github/workflows/build-multi-static.yml @@ -148,6 +148,7 @@ jobs: -D CMAKE_C_COMPILER_LAUNCHER=ccache \ -D CMAKE_CXX_COMPILER_LAUNCHER=ccache \ -D CMAKE_BUILD_TYPE=Release \ + -D BUILD_STATIC=1 \ -D CMAKE_INSTALL_PREFIX=${{ matrix.target == 'install' && '../level-zero-install' || matrix.target == 'package' && '/usr' || '' }} \ -D CPACK_OUTPUT_FILE_PREFIX=${MOUNT_TARGET}/level-zero-package \ .. diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 361edea0..fab3f3a0 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -15,7 +15,11 @@ target_link_libraries( # For some reason the MSVC runtime libraries used by googletest and test # binaries don't match, so force the test binary to use the dynamic runtime. if(MSVC) + if (BUILD_STATIC) + target_compile_options(tests PRIVATE "/MT$<$:d>") + else() target_compile_options(tests PRIVATE "/MD$<$:d>") + endif() endif() add_test(NAME tests_api COMMAND tests --gtest_filter=-*LoaderInit*)