Skip to content

Commit 44c85e0

Browse files
committed
Simplify logic
1 parent b03ff95 commit 44c85e0

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

CMakeLists.txt

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ project(YSTDLIB_CPP LANGUAGES CXX)
33

44
set(YSTDLIB_CPP_VERSION "0.0.1" CACHE STRING "Project version.")
55

6-
include(CMakeDependentOption)
7-
86
# Enable exporting compile commands
97
set(CMAKE_EXPORT_COMPILE_COMMANDS
108
ON
@@ -18,13 +16,9 @@ if(YSTDLIB_CPP_IS_TOP_LEVEL)
1816
endif()
1917

2018
option(YSTDLIB_CPP_BUILD_TESTING "Build the testing tree for ystdlib-cpp." ON)
21-
cmake_dependent_option(
22-
YSTDLIB_CPP_ENABLE_TESTS
23-
"Enable unit tests."
24-
ON
25-
"BUILD_TESTING;YSTDLIB_CPP_BUILD_TESTING"
26-
OFF
27-
)
19+
if(BUILD_TESTING AND YSTDLIB_CPP_BUILD_TESTING)
20+
set(YSTDLIB_CPP_ENABLE_TESTS ON)
21+
endif()
2822

2923
# Import CMake helper functions
3024
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/CMake)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ An open-source C++ library developed and used at YScope.
88
Clone `ystdlib-cpp` into your project. Then, in your project's `CMakeLists.txt`, add the following:
99
```cmake
1010
# Uncomment the next line if you do not want to build ystdlib-cpp's unit tests.
11-
# option(YSTDLIB_CPP_BUILD_TESTING "Build the testing tree for ystdlib-cpp." OFF)
11+
# set(YSTDLIB_CPP_BUILD_TESTING OFF)
1212
add_subdirectory(/path/to/ystdlib-cpp EXCLUDE_FROM_ALL)
1313
target_link_libraries(<target_name> <link_options>
1414
ystdlib::<lib_1> ystdlib::<lib_2> ... ystdlib::<lib_N>

0 commit comments

Comments
 (0)