File tree Expand file tree Collapse file tree 2 files changed +25
-5
lines changed Expand file tree Collapse file tree 2 files changed +25
-5
lines changed Original file line number Diff line number Diff line change 94
94
- name : print environment
95
95
run : env
96
96
- name : configure
97
- run : cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
97
+ run : cmake -S . -B build -DWERROR=ON - DCMAKE_BUILD_TYPE=Release
98
98
- name : build
99
- run : cmake --build build --parallel 3
99
+ run : cmake --build build --parallel 8
100
100
env :
101
101
CC : ${{ matrix.cc }}
102
102
CXX : ${{ matrix.cxx }}
@@ -157,11 +157,11 @@ jobs:
157
157
- name : print environment
158
158
run : env
159
159
- name : configure
160
- run : cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
160
+ run : cmake -S . -B build -DWERROR=ON - DCMAKE_BUILD_TYPE=Release
161
161
env :
162
162
DEVELOPER_DIR : /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer
163
163
- name : build
164
- run : cmake --build build --parallel 3 --verbose
164
+ run : cmake --build build --parallel 8 --verbose
165
165
- name : test
166
166
run : ./build/test/jsonrpcpp_test
167
167
@@ -195,6 +195,6 @@ jobs:
195
195
-DVCPKG_TARGET_TRIPLET="x64-windows" `
196
196
-DCMAKE_BUILD_TYPE=Release `"
197
197
- name : build
198
- run : cmake --build build --config Release --parallel 3 --verbose
198
+ run : cmake --build build --config Release --parallel 8 --verbose
199
199
- name : test
200
200
run : .\build\test\Release\jsonrpcpp_test.exe
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ set(PROJECT_URL "https://github.com/badaix/jsonrpcpp")
18
18
19
19
option (BUILD_EXAMPLE "Build example (build jsonrpcpp_example demo)" ON )
20
20
option (BUILD_TESTS "Build tests" ON )
21
+ option (WERROR "Treat warnings as errors" OFF )
21
22
22
23
set (CMAKE_CXX_STANDARD 11 )
23
24
set (CMAKE_CXX_EXTENSIONS OFF )
@@ -35,6 +36,25 @@ include_directories(
35
36
install (FILES include /jsonrpcpp.hpp include /json.hpp
36
37
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR} /jsonrpcpp" )
37
38
39
+ if (MSVC )
40
+ # warning level 4 and all warnings as errors warning C4505: 'getArch':
41
+ # unreferenced local function has been removed warning C4458: declaration of
42
+ # 'size' hides class member warning C4459: declaration of 'query' hides global
43
+ # declaration
44
+ add_compile_options (/W4 /wd4458 /wd4459 /wd4505 )
45
+ if (WERROR )
46
+ add_compile_options (/WX )
47
+ endif ()
48
+ else ()
49
+ # lots of warnings and all warnings as errors
50
+ add_compile_options (-Wall -Wextra -pedantic )
51
+
52
+ if (WERROR )
53
+ add_compile_options (-Werror )
54
+ endif ()
55
+ endif ()
56
+
57
+
38
58
if (BUILD_EXAMPLE )
39
59
add_subdirectory (example )
40
60
endif (BUILD_EXAMPLE )
You can’t perform that action at this time.
0 commit comments