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")
10
10
# This must be in the top-level CMakeLists.txt to enable CMake/CTest support.
11
11
include (CTest)
12
12
13
+ set (CMAKE_C_STANDARD 11)
14
+ set (CMAKE_C_STANDARD_REQUIRED ON )
13
15
set (CMAKE_CXX_STANDARD 17)
14
16
set (CMAKE_CXX_STANDARD_REQUIRED ON )
15
17
set (CMAKE_EXPORT_COMPILE_COMMANDS ON )
16
18
17
19
SET (GCC_COVERAGE_COMPILE_FLAGS "-fsanitize=address -fprofile-arcs -ftest-coverage -g -O0" )
18
20
SET (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 ()
21
32
22
33
add_subdirectory (src/lib/exercises)
23
34
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" )
2
2
add_library (exercises STATIC ${SOURCES} )
3
3
4
4
target_include_directories (exercises
@@ -7,11 +7,6 @@ target_include_directories(exercises
7
7
$<INSTALL_INTERFACE:include >
8
8
)
9
9
10
- target_compile_options (exercises
11
- PUBLIC
12
- -save-temps
13
- )
14
-
15
10
install (TARGETS exercises
16
11
EXPORT exercisesConfig
17
12
ARCHIVE DESTINATION lib
You can’t perform that action at this time.
0 commit comments