Skip to content

Commit 26a083b

Browse files
committed
Add CLI option for unit tests
1 parent 7b44e36 commit 26a083b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ set(CMAKE_CXX_STANDARD 17)
77
set(CMAKE_CXX_STANDARD_REQUIRED ON)
88
set(ZIP_SRC thirdparty/zip/src)
99

10+
option(LIBSCRATCHCPP_BUILD_UNIT_TESTS "Build unit tests" ON)
11+
1012
find_package(nlohmann_json 3.9.1 REQUIRED)
1113
find_package(utf8cpp REQUIRED)
1214

@@ -27,7 +29,6 @@ target_link_libraries(scratchcpp PRIVATE zip)
2729

2830
target_compile_definitions(scratchcpp PRIVATE LIBSCRATCHCPP_LIBRARY)
2931

30-
set (BUILD_TESTING TRUE)
31-
if (BUILD_TESTING)
32+
if (LIBSCRATCHCPP_BUILD_UNIT_TESTS)
3233
add_subdirectory(test)
3334
endif()

0 commit comments

Comments
 (0)