mirror of
https://github.com/charles-lunarg/vk-bootstrap.git
synced 2024-11-22 07:24:34 +00:00
Dont enable tests if building standalone
Previously, tests would always be enabled if the repo was the top level project, which isn't desireable for users. This alters the logic to, by default, only enabling tests when its a top level project, but still allowing users to *not* enable tests by setting VK_BOOTSTRAP_TEST to off.
This commit is contained in:
parent
be26f7d464
commit
4ae9513ff9
@ -81,10 +81,15 @@ install(TARGETS vk-bootstrap vk-bootstrap-compiler-warnings vk-bootstrap-vulkan-
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||
|
||||
option(VK_BOOTSTRAP_TEST "Test Vk-Bootstrap with glfw and Catch2" OFF)
|
||||
|
||||
if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME OR VK_BOOTSTRAP_TEST)
|
||||
# By default, we want to only build tests if this repo is built standalone, but still should be configurable by the user
|
||||
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
|
||||
set(VK_BOOTSTRAP_TEST_DEFAULT_VALUE ON)
|
||||
else()
|
||||
set(VK_BOOTSTRAP_TEST_DEFAULT_VALUE OFF)
|
||||
endif()
|
||||
option(VK_BOOTSTRAP_TEST "Test Vk-Bootstrap with glfw and Catch2" ${VK_BOOTSTRAP_TEST_DEFAULT_VALUE})
|
||||
|
||||
if(VK_BOOTSTRAP_TEST)
|
||||
add_subdirectory(ext)
|
||||
add_subdirectory(tests)
|
||||
add_subdirectory(example)
|
||||
|
Loading…
Reference in New Issue
Block a user