2023-09-29 23:47:44 +00:00
|
|
|
if (WIN32)
|
|
|
|
add_library(VulkanMock SHARED vulkan_mock.hpp vulkan_mock.cpp)
|
|
|
|
# Need to name the target "vulkan-1" so that it'll be loaded instead of the *actual* vulkan-1.dll on the system
|
|
|
|
set_target_properties(VulkanMock PROPERTIES OUTPUT_NAME "vulkan-1")
|
|
|
|
else()
|
|
|
|
add_library(VulkanMock STATIC vulkan_mock.hpp vulkan_mock.cpp)
|
|
|
|
endif()
|
|
|
|
target_link_libraries(VulkanMock
|
|
|
|
PUBLIC
|
|
|
|
vk-bootstrap-vulkan-headers
|
|
|
|
PRIVATE
|
|
|
|
vk-bootstrap-compiler-warnings
|
|
|
|
)
|
|
|
|
target_compile_features(VulkanMock PUBLIC cxx_std_17)
|
|
|
|
|
2023-09-19 20:32:22 +00:00
|
|
|
add_executable(vk-bootstrap-test
|
2023-09-29 23:47:44 +00:00
|
|
|
vulkan_library_loader.hpp
|
2023-09-19 20:32:22 +00:00
|
|
|
bootstrap_tests.cpp
|
|
|
|
error_code_tests.cpp
|
2023-09-29 23:47:44 +00:00
|
|
|
unit_tests.cpp
|
|
|
|
)
|
2023-09-19 20:32:22 +00:00
|
|
|
|
2020-03-26 16:40:47 +00:00
|
|
|
target_link_libraries(vk-bootstrap-test
|
2020-06-17 23:13:39 +00:00
|
|
|
PRIVATE
|
|
|
|
vk-bootstrap
|
2021-09-06 21:06:44 +00:00
|
|
|
vk-bootstrap-vulkan-headers
|
2020-06-17 23:13:39 +00:00
|
|
|
vk-bootstrap-compiler-warnings
|
2023-09-29 23:47:44 +00:00
|
|
|
VulkanMock
|
2023-09-19 20:32:22 +00:00
|
|
|
Catch2::Catch2WithMain
|
2021-09-06 21:06:44 +00:00
|
|
|
)
|
2023-09-19 20:32:22 +00:00
|
|
|
|
2023-10-13 16:50:57 +00:00
|
|
|
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
|
|
|
|
target_compile_options(vk-bootstrap-test PRIVATE -Wno-error=deprecated-declarations)
|
|
|
|
elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
|
|
|
target_compile_options(vk-bootstrap-test PRIVATE /wd4996)
|
|
|
|
endif()
|
|
|
|
|
2023-10-03 22:22:02 +00:00
|
|
|
list(APPEND CMAKE_MODULE_PATH ${Catch2_SOURCE_DIR}/extras)
|
|
|
|
include(CTest)
|
|
|
|
include(Catch)
|
|
|
|
catch_discover_tests(vk-bootstrap-test)
|