Skip to content

Commit 15882de

Browse files
committed
cmake: Enable BUILD_TESTING by default if build type is coverage
1 parent fbcc8c0 commit 15882de

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
2424
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo" "Coverage")
2525
endif()
2626

27+
# Coverage
28+
set(_is_coverage_build 0)
2729
set(_msg "Checking if build type is 'Coverage'")
2830
message(STATUS "${_msg}")
2931
if(NOT CMAKE_CONFIGURATION_TYPES)
@@ -133,7 +135,7 @@ set(PKG_CONFIG_DIR ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
133135

134136
# --------------------------------------------------
135137
# Testing
136-
option(BUILD_TESTING "Build tests" OFF)
138+
option(BUILD_TESTING "Build tests" ${_is_coverage_build})
137139
include(CTest)
138140
message(STATUS "Build tests: ${BUILD_TESTING}")
139141

0 commit comments

Comments
 (0)