File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55 branches : [ master ]
66 pull_request :
77 branches : [ master ]
8-
98env :
109 # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
1110 BUILD_TYPE : Release
3938 - name : Configure CMake
4039 # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
4140 # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
41+
42+ # The macro ${{github.workspace}} results in windows file seprators, (\) which CMake often cannot parse.
43+ # To get around this use a relative path instead.
4244 run : |
4345 if [ ${{ matrix.os }} == 'windows-latest' ]; then
44- cmake -DTEST=ON -Dgtest_disable_pthreads=ON -B ${{github.workspace}} /build
46+ cmake -DTEST=ON -Dgtest_disable_pthreads=ON -B . /build
4547 else
4648 cmake -DTEST=ON -B ${{github.workspace}}/build
4749 fi;
Original file line number Diff line number Diff line change @@ -19,17 +19,19 @@ if(DEBUG)
1919 )
2020endif (DEBUG )
2121
22- option (SANITIZE "Enable Sanitize" OFF )
23- if (SANITIZE)
24- add_compile_options (
25- -fsanitize=address
26- -fsanitize=leak
27- )
28- add_link_options (
29- -fsanitize=address
30- -fsanitize=leak
31- )
32- endif (SANITIZE )
22+ if (NOT MSVC )
23+ option (SANITIZE "Enable Sanitize" OFF )
24+ if (SANITIZE)
25+ add_compile_options (
26+ -fsanitize=address
27+ -fsanitize=leak
28+ )
29+ add_link_options (
30+ -fsanitize=address
31+ -fsanitize=leak
32+ )
33+ endif (SANITIZE )
34+ endif (NOT MSVC )
3335
3436# set up CPM.cmake
3537if (CPM_SOURCE_CACHE)
@@ -52,5 +54,4 @@ add_subdirectory(test)
5254add_subdirectory (benchmark )
5355add_subdirectory (examples )
5456
55- #install(FILES include/Graph.hpp DESTINATION /usr/include)
5657install (DIRECTORY ${PROJECT_SOURCE_DIR} /include/ DESTINATION include)
Original file line number Diff line number Diff line change 1- option (CODE_COVERAGE "Enable coverage reporting" OFF )
21option (CMAKE_USE_WIN32_THREADS_INIT "using WIN32 threads" ON )
32option (gtest_disable_pthreads "Disable uses of pthreads in gtest." ON )
43
54# Force dynamic linking since MSVC now links C runtimes dynamically by default
65set (gtest_force_shared_crt on )
76
8- if (CODE_COVERAGE)
9- message ( "Code Coverage Enabled" )
10- add_compile_options (
11- -O0 #no optimization
12- -g #generate debug info
13- --coverage #set coverage flag
14- -fprofile-arcs
15- -ftest-coverage
16- -fPIC
17- )
18- link_libraries (
19- "gcov"
20- "-fprofile-arcs"
21- "--coverage"
22- )
7+ if (NOT MSVC )
8+ option (CODE_COVERAGE "Enable coverage reporting" OFF )
9+ if (CODE_COVERAGE)
10+ message ( "Code Coverage Enabled" )
11+ add_compile_options (
12+ -O0 #no optimization
13+ -g #generate debug info
14+ --coverage #set coverage flag
15+ -fprofile-arcs
16+ -ftest-coverage
17+ -fPIC
18+ )
19+ link_libraries (
20+ "gcov"
21+ "-fprofile-arcs"
22+ "--coverage"
23+ )
2324
24- endif (CODE_COVERAGE )
25+ endif (CODE_COVERAGE )
26+ endif (NOT MSVC )
2527
2628option (TEST "Enable Test" OFF )
2729if (TEST )
2830 include (${CPM_DOWNLOAD_LOCATION} )
29- add_compile_options (
30- -Wall
31- -Wextra
32- )
31+ if (NOT MSVC )
32+ add_compile_options (
33+ -Wall
34+ -Wextra
35+ )
36+ endif (NOT MSVC )
3337
3438 CPMAddPackage (
3539 NAME googletest
You can’t perform that action at this time.
0 commit comments