Skip to content

Commit

Permalink
Do not hardcode warnings as errors
Browse files Browse the repository at this point in the history
Signed-off-by: Juan Cruz Viotti <[email protected]>
  • Loading branch information
jviotti committed Jul 31, 2023
1 parent 2dcf6b1 commit 29b90da
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.21)
cmake_minimum_required(VERSION 3.24)
project("JSON BinPack" VERSION 0.0.1 LANGUAGES CXX
DESCRIPTION "\
A space-efficient open-source binary JSON serialization \
Expand Down
6 changes: 4 additions & 2 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,17 @@
"displayName": "Release",
"binaryDir": "build",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release"
"CMAKE_BUILD_TYPE": "Release",
"CMAKE_COMPILE_WARNING_AS_ERROR": "ON"
}
},
{
"name": "debug",
"displayName": "Debug",
"binaryDir": "build",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug"
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_COMPILE_WARNING_AS_ERROR": "ON"
}
}
],
Expand Down
3 changes: 1 addition & 2 deletions cmake/warnings.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "App
add_compile_options(
-Wall
-Wextra
-Werror
-Wpedantic
-Wshadow
-Wdouble-promotion
Expand Down Expand Up @@ -88,7 +87,7 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
# See https://www.postgresql.org/message-id/[email protected]
-fwrapv)
elseif(MSVC)
add_compile_options(/options:strict /W4 /WX /WL /sdl)
add_compile_options(/options:strict /W4 /WL /sdl)
else()
message(WARNING "Unrecognized compiler: ${CMAKE_CXX_COMPILER_ID}")
endif()

0 comments on commit 29b90da

Please sign in to comment.