Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions .github/workflows/build-quick-static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ jobs:
-D CMAKE_C_COMPILER_LAUNCHER=ccache \
-D CMAKE_CXX_COMPILER_LAUNCHER=ccache \
-D CMAKE_BUILD_TYPE=Release \
-D BUILD_L0_LOADER_TESTS=1 \
-D BUILD_STATIC=0 \
..
make -j$(nproc)
Expand All @@ -49,13 +48,20 @@ jobs:
runs-on: [windows-latest]
steps:
- uses: actions/checkout@v3
- name: Build Loader on Latest Windows
- name: Build Static Loader on Latest Windows
run: |
mkdir build
cd build
cmake -D BUILD_L0_LOADER_TESTS=1 -D BUILD_STATIC=1 ..
cmake --build . --config Release
- name: Build Dynamic Loader on Latest Windows
run: |
cd ${{ github.workspace }}
mkdir dynamic_build
cd dynamic_build
cmake -D BUILD_L0_LOADER_TESTS=0 -D BUILD_STATIC=0 ..
cmake --build . --config Release
- env:
ZEL_LIBRARY_PATH: '${{ github.workspace }}/build/bin/Release'
ZEL_LIBRARY_PATH: '${{ github.workspace }}/dynamic_build/bin/Release'
working-directory: build
run: ctest -C Release -V
9 changes: 2 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ endif()

include(FetchContent)

if(BUILD_L0_LOADER_TESTS AND (NOT MSVC OR (MSVC AND NOT BUILD_STATIC)))
if(BUILD_L0_LOADER_TESTS)
FetchContent_Declare(
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
Expand All @@ -61,11 +61,6 @@ if(BUILD_L0_LOADER_TESTS AND (NOT MSVC OR (MSVC AND NOT BUILD_STATIC)))
add_library(GTest::GTest INTERFACE IMPORTED)
target_link_libraries(GTest::GTest INTERFACE gtest_main)

# For Windows: Prevent overriding the parent project's compiler/linker settings
if(MSVC)
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
endif()

FetchContent_MakeAvailable(googletest)

enable_testing()
Expand Down Expand Up @@ -229,7 +224,7 @@ set(TARGET_LOADER_NAME ze_loader)
add_subdirectory(source)
add_subdirectory(samples)

if(BUILD_L0_LOADER_TESTS AND (NOT MSVC OR (MSVC AND NOT BUILD_STATIC)))
if(BUILD_L0_LOADER_TESTS)
include(CTest)
add_subdirectory(test)
endif()
Expand Down
6 changes: 0 additions & 6 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@ target_link_libraries(
${TARGET_LOADER_NAME}
)

# 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)
target_compile_options(tests PRIVATE "/MD$<$<CONFIG:Debug>:d>")
endif()

add_test(NAME tests_api COMMAND tests --gtest_filter=*GivenLevelZeroLoaderPresentWhenCallingzeGetLoaderVersionsAPIThenValidVersionIsReturned*)
set_property(TEST tests_api PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DEBUG_TRACE=1;ZE_ENABLE_NULL_DRIVER=1")
add_test(NAME tests_init_gpu_all COMMAND tests --gtest_filter=*GivenLevelZeroLoaderPresentWhenCallingZeInitDriversWithGPUTypeThenExpectPassWithGPUorAllOnly*)
Expand Down
Loading