mirror of
https://github.com/pocoproject/poco.git
synced 2025-02-20 14:24:35 +01:00
enh(ci): Add ENABLE_COMPILER_WARNINGS to cmake to enable additional compiler warnings
This commit is contained in:
parent
1e4c08b4eb
commit
381467d8f5
@ -206,6 +206,9 @@ endif()
|
||||
option(ENABLE_TESTS
|
||||
"Set to OFF|ON (default is OFF) to control build of POCO tests" OFF)
|
||||
|
||||
option(ENABLE_COMPILER_WARNINGS
|
||||
"Set to OFF|ON (default is OFF) to enable additional compiler warnings. Intended primarily for maintainers." OFF)
|
||||
|
||||
option(ENABLE_SAMPLES
|
||||
"Set to OFF|ON (default is OFF) to control build of POCO samples" OFF)
|
||||
|
||||
|
@ -49,7 +49,20 @@ else(MSVC)
|
||||
set(STATIC_POSTFIX "" CACHE STRING "Set static library postfix" FORCE)
|
||||
endif(MSVC)
|
||||
|
||||
|
||||
if (ENABLE_COMPILER_WARNINGS)
|
||||
message(STATUS "Enabling additional compiler warning flags.")
|
||||
# Additional compiler-specific warning flags
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
# using clang
|
||||
add_compile_options(-Wall -Wextra -Wpedantic -Wno-unused-parameter)
|
||||
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
# using GCC
|
||||
add_compile_options(-Wall -Wextra -Wpedantic -Wno-unused-parameter)
|
||||
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||
# using Visual Studio C++
|
||||
add_compile_options(/W4)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Add a d postfix to the debug libraries
|
||||
if(BUILD_SHARED_LIBS)
|
||||
|
Loading…
x
Reference in New Issue
Block a user