Skip to content

Commit a4771a3

Browse files
committed
build(net): guard tests subdirectory when tests are absent
1 parent 117f77f commit a4771a3

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

CMakeLists.txt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,13 @@ endif()
147147
option(VIX_NET_BUILD_TESTS "Build net module tests" OFF)
148148

149149
if (VIX_NET_BUILD_TESTS)
150-
include(CTest)
151-
enable_testing()
152-
add_subdirectory(tests)
150+
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/tests/CMakeLists.txt")
151+
include(CTest)
152+
enable_testing()
153+
add_subdirectory(tests)
154+
else()
155+
message(WARNING "[net/tests] VIX_NET_BUILD_TESTS=ON but tests/CMakeLists.txt not found, skipping.")
156+
endif()
153157
endif()
154158

155159
# Summary

0 commit comments

Comments
 (0)