Skip to content

Commit

Permalink
CMakeLists.txt: respect BUILD_TESTING
Browse files Browse the repository at this point in the history
Don't build tests if the standard cmake BUILD_TESTING variable is set to
OFF.

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  • Loading branch information
ffontaine committed Apr 17, 2021
1 parent 9f85f3a commit 03daae4
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

#-----------------------------------------------------------------------------

option(BUILD_TESTING "Build tests" ON)
option(WERROR "Add -Werror flag to build (turns warnings into errors)" ON)

if(MSVC)
Expand Down Expand Up @@ -134,13 +135,13 @@ install(DIRECTORY include/protozero DESTINATION include)

#-----------------------------------------------------------------------------

enable_testing()

add_subdirectory(doc)

add_subdirectory(tools)

add_subdirectory(test)

if(BUILD_TESTING)
enable_testing()
add_subdirectory(test)
endif()

#-----------------------------------------------------------------------------

0 comments on commit 03daae4

Please sign in to comment.