File tree Expand file tree Collapse file tree 2 files changed +48
-2
lines changed Expand file tree Collapse file tree 2 files changed +48
-2
lines changed Original file line number Diff line number Diff line change 44
44
${{ matrix.package }}/test/*
45
45
fail-under-line : 100
46
46
47
+ debug-msvc :
48
+ runs-on : windows-latest
49
+ strategy :
50
+ matrix :
51
+ package : [error]
52
+ steps :
53
+ - name : Checkout repository
54
+ uses : actions/checkout@v3.5.3
55
+
56
+ - name : Configure CMake
57
+ run : |
58
+ cmake ${{ matrix.package }} `
59
+ -B ${{ matrix.package }}/build `
60
+ -D CMAKE_CXX_COMPILER=cl `
61
+ -D CMAKE_CXX_FLAGS=/WX `
62
+ -D BUILD_TESTING=ON
63
+
64
+ - name : Build project
65
+ run : cmake --build ${{ matrix.package }}/build
66
+
67
+ - name : Run unit tests
68
+ run : ctest --test-dir ${{ matrix.package }}/build --output-on-failure --no-tests=error
69
+
47
70
release :
48
71
runs-on : ubuntu-latest
49
72
strategy :
58
81
with :
59
82
source-dir : ${{ matrix.package }}
60
83
build-dir : ${{ matrix.package }}/build
84
+
85
+ release-msvc :
86
+ runs-on : windows-latest
87
+ strategy :
88
+ matrix :
89
+ package : [error]
90
+ steps :
91
+ - name : Checkout repository
92
+ uses : actions/checkout@v3.5.3
93
+
94
+ - name : Configure and build project
95
+ uses : threeal/cmake-action@v1.1.0
96
+ with :
97
+ source-dir : ${{ matrix.package }}
98
+ build-dir : ${{ matrix.package }}/build
99
+ cxx-compiler : cl
Original file line number Diff line number Diff line change @@ -2,7 +2,12 @@ cmake_minimum_required(VERSION 3.0)
2
2
3
3
project (error )
4
4
5
- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wnon-virtual-dtor -Wpedantic" )
5
+ if (MSVC )
6
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /permissive- /W4 /w14640 /EHsc" )
7
+ else ()
8
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wnon-virtual-dtor -Wpedantic" )
9
+ endif ()
10
+
6
11
set (CMAKE_CXX_STANDARD 11 )
7
12
8
13
include (cmake/CPM.cmake )
@@ -21,7 +26,9 @@ if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
21
26
cpmaddpackage ("gh:catchorg/Catch2@3.3.2" )
22
27
include ("${Catch2_SOURCE_DIR} /extras/Catch.cmake" )
23
28
24
- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage -fPIC -O0" )
29
+ if (NOT MSVC )
30
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage -fPIC -O0" )
31
+ endif ()
25
32
26
33
add_executable (error_test test /error_test.cpp )
27
34
target_link_libraries (error_test PRIVATE error Catch2::Catch2WithMain )
You can’t perform that action at this time.
0 commit comments