From 6f4c1f95be09e55c28677fbf1d9c2aa06d600d1f Mon Sep 17 00:00:00 2001 From: effolkronium Date: Sat, 5 Aug 2017 19:57:45 +0300 Subject: [PATCH] Fix --- test/CMakeLists.txt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index a2312a0..a03688c 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,6 +1,13 @@ project(effolkronium_random_test) # Enable C language support for pthread find_package(Threads REQUIRED) + +if(COVERAGE_ENABLED) + message(STATUS "COVERAGE ENABLED") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0") # debug, no optimisation + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage") # enabling coverage +endif() + include(set_up_warnings.cmake) #[[ @@ -17,11 +24,6 @@ function(add_basic_test TARGET COMPILE_DEFS TEST_SOURCES) target_compile_definitions(${TARGET} PRIVATE ${COMPILE_DEFS}) target_include_directories(${TARGET} PRIVATE "../include" ${CMAKE_CURRENT_SOURCE_DIR}) - if(COVERAGE_ENABLED) - message(STATUS "COVERAGE ENABLED") - target_compile_options(${TARGET} PRIVATE -g -O0 --coverage) - endif() - set_target_properties(${TARGET} PROPERTIES CXX_STANDARD 11 CXX_STANDARD_REQUIRED ON