From f6fdcad7f3ad611f22ec5a6d66eeba76fc87886b Mon Sep 17 00:00:00 2001 From: AnonN10 <69523725+AnonN10@users.noreply.github.com> Date: Fri, 11 Aug 2023 19:33:44 +0700 Subject: [PATCH] make doctest dependency optional --- CMakeLists.txt | 8 ++++---- src/Util.cpp | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9eaf46a4..779d82db 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -181,11 +181,11 @@ if(VUK_BUILD_DOCS) endif() -add_subdirectory(ext/doctest) -target_link_libraries(vuk PUBLIC doctest::doctest) -target_sources(vuk PRIVATE src/tests/Test.cpp) - if(VUK_BUILD_TESTS) + add_subdirectory(ext/doctest) + target_link_libraries(vuk PUBLIC doctest::doctest) + target_sources(vuk PRIVATE src/tests/Test.cpp) + FetchContent_Declare( vk-bootstrap GIT_REPOSITORY https://github.com/charles-lunarg/vk-bootstrap diff --git a/src/Util.cpp b/src/Util.cpp index dd784b38..a7333650 100644 --- a/src/Util.cpp +++ b/src/Util.cpp @@ -6,7 +6,9 @@ #include "vuk/SampledImage.hpp" #include +#ifndef DOCTEST_CONFIG_DISABLE #include +#endif #include #include #include @@ -248,6 +250,7 @@ namespace vuk { bundle.batches = { dst_batch }; } +#ifndef DOCTEST_CONFIG_DISABLE TEST_CASE("testing flattening submit graphs") { { SubmitBundle empty{}; @@ -293,6 +296,7 @@ namespace vuk { CHECK(after == "digraph {subgraph cluster_Graphics {GA;GB;GC;GD;GE;GF;GG;GH;}GC->GB;GD->GC;GE->GD;GF->GE;GG->GF;GH->GG;}"); } } +#endif Result submit(Allocator& allocator, SubmitBundle bundle, VkSemaphore present_rdy, VkSemaphore render_complete) { Context& ctx = allocator.get_context();