Properly enable CMAKE_COMPILE_WARNING_AS_ERROR (#19828)

* Properly enable CMAKE_COMPILE_WARNING_AS_ERROR_DEFAULT

* Properly enable CMAKE_COMPILE_WARNING_AS_ERROR
This commit is contained in:
Ilya Lavrenov
2023-09-15 01:20:00 +04:00
committed by GitHub
parent 18f29c02d2
commit ba67db66ae
17 changed files with 48 additions and 23 deletions

View File

@@ -14,7 +14,11 @@ else()
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -diag-disable=266")
endif()
if(CMAKE_CXX_COMPILER_ID MATCHES "^(Apple)?Clang$")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-deprecated-non-prototype")
include(CheckCCompilerFlag)
check_c_compiler_flag("-Wdeprecated-non-prototype" DEPRECATED_NO_PROTOTYPE)
if(DEPRECATED_NO_PROTOTYPE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-deprecated-non-prototype")
endif()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-variable")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-deprecated-declarations")
endif()