Skip to content

Commit

Permalink
make doctest dependency optional
Browse files Browse the repository at this point in the history
  • Loading branch information
AnonN10 authored and martty committed Aug 13, 2023
1 parent 1dc7c2c commit f6fdcad
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 4 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions src/Util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
#include "vuk/SampledImage.hpp"

#include <atomic>
#ifndef DOCTEST_CONFIG_DISABLE
#include <doctest/doctest.h>
#endif
#include <mutex>
#include <sstream>
#include <utility>
Expand Down Expand Up @@ -248,6 +250,7 @@ namespace vuk {
bundle.batches = { dst_batch };
}

#ifndef DOCTEST_CONFIG_DISABLE
TEST_CASE("testing flattening submit graphs") {
{
SubmitBundle empty{};
Expand Down Expand Up @@ -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<void> submit(Allocator& allocator, SubmitBundle bundle, VkSemaphore present_rdy, VkSemaphore render_complete) {
Context& ctx = allocator.get_context();
Expand Down

0 comments on commit f6fdcad

Please sign in to comment.