File tree Expand file tree Collapse file tree 2 files changed +14
-8
lines changed Expand file tree Collapse file tree 2 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -10,14 +10,25 @@ list(APPEND CMAKE_CTEST_ARGUMENTS "--output-on-failure")
1010# This must be in the top-level CMakeLists.txt to enable CMake/CTest support.
1111include (CTest)
1212
13+ set (CMAKE_C_STANDARD 11)
14+ set (CMAKE_C_STANDARD_REQUIRED ON )
1315set (CMAKE_CXX_STANDARD 17)
1416set (CMAKE_CXX_STANDARD_REQUIRED ON )
1517set (CMAKE_EXPORT_COMPILE_COMMANDS ON )
1618
1719SET (GCC_COVERAGE_COMPILE_FLAGS "-fsanitize=address -fprofile-arcs -ftest-coverage -g -O0" )
1820SET (GCC_COVERAGE_LINK_FLAGS "--coverage" )
19- SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_COVERAGE_COMPILE_FLAGS} " )
20- SET (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${GCC_COVERAGE_LINK_FLAGS} " )
21+
22+ if (CMAKE_GENERATOR MATCHES "Unix Makefiles" )
23+
24+ SET (CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_COVERAGE_COMPILE_FLAGS} " )
25+ SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_COVERAGE_COMPILE_FLAGS} " )
26+ SET (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} ${GCC_COVERAGE_COMPILE_FLAGS} " )
27+ SET (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} ${GCC_COVERAGE_COMPILE_FLAGS} " )
28+
29+ SET (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${GCC_COVERAGE_LINK_FLAGS} " )
30+
31+ endif ()
2132
2233add_subdirectory (src/lib/exercises)
2334
Original file line number Diff line number Diff line change 1- file (GLOB_RECURSE SOURCES "src/*.cpp" )
1+ file (GLOB_RECURSE SOURCES "src/*.c" "src/*. cpp" )
22add_library (exercises STATIC ${SOURCES} )
33
44target_include_directories (exercises
@@ -7,11 +7,6 @@ target_include_directories(exercises
77 $<INSTALL_INTERFACE:include >
88)
99
10- target_compile_options (exercises
11- PUBLIC
12- -save-temps
13- )
14-
1510install (TARGETS exercises
1611 EXPORT exercisesConfig
1712 ARCHIVE DESTINATION lib
You can’t perform that action at this time.
0 commit comments