From 72980c5ec920c4ad8868bb1b32d71947b62f10ea Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Mon, 31 Jul 2023 15:49:49 -0400 Subject: [PATCH] Do not hardcode warnings as errors (#646) Signed-off-by: Juan Cruz Viotti --- CMakeLists.txt | 2 +- CMakePresets.json | 6 ++++-- cmake/warnings.cmake | 3 +-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 88c6fac1..2d0df406 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 \ diff --git a/CMakePresets.json b/CMakePresets.json index 644b145e..e286d861 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -6,7 +6,8 @@ "displayName": "Release", "binaryDir": "build", "cacheVariables": { - "CMAKE_BUILD_TYPE": "Release" + "CMAKE_BUILD_TYPE": "Release", + "CMAKE_COMPILE_WARNING_AS_ERROR": true } }, { @@ -14,7 +15,8 @@ "displayName": "Debug", "binaryDir": "build", "cacheVariables": { - "CMAKE_BUILD_TYPE": "Debug" + "CMAKE_BUILD_TYPE": "Debug", + "CMAKE_COMPILE_WARNING_AS_ERROR": true } } ], diff --git a/cmake/warnings.cmake b/cmake/warnings.cmake index 09a90541..6f71929e 100644 --- a/cmake/warnings.cmake +++ b/cmake/warnings.cmake @@ -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 @@ -88,7 +87,7 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") # See https://www.postgresql.org/message-id/1689.1134422394@sss.pgh.pa.us -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()