Skip to content

Commit 9e9dcf4

Browse files
author
Gonzalo Diaz
committed
[CONFIG] [Github Actions] C/C++ for windows.
1 parent 950040c commit 9e9dcf4

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

CMakeLists.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,15 @@ set(CMAKE_CXX_STANDARD 17)
1616
set(CMAKE_CXX_STANDARD_REQUIRED ON)
1717
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
1818

19-
SET(GCC_COVERAGE_COMPILE_FLAGS "-fsanitize=address -fprofile-arcs -ftest-coverage -g -O0")
19+
SET(GCC_COVERAGE_COMPILE_FLAGS "-fsanitize=address -fprofile-arcs -ftest-coverage -g -O0 -save-temps")
2020
SET(GCC_COVERAGE_LINK_FLAGS "--coverage")
2121

2222
if (CMAKE_GENERATOR MATCHES "Unix Makefiles")
2323

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_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${GCC_COVERAGE_LINK_FLAGS}")
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}")
2728

2829
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${GCC_COVERAGE_LINK_FLAGS}")
2930

src/lib/exercises/CMakeLists.txt

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
file (GLOB_RECURSE SOURCES "src/*.c")
1+
file (GLOB_RECURSE SOURCES "src/*.c" "src/*.cpp")
22
add_library(exercises STATIC ${SOURCES})
33

44
target_include_directories(exercises
@@ -7,13 +7,6 @@ target_include_directories(exercises
77
$<INSTALL_INTERFACE:include>
88
)
99

10-
set_property(TARGET exercises PROPERTY C_STANDARD 11)
11-
12-
target_compile_options(exercises
13-
PUBLIC
14-
-save-temps
15-
)
16-
1710
install(TARGETS exercises
1811
EXPORT exercisesConfig
1912
ARCHIVE DESTINATION lib

0 commit comments

Comments
 (0)