Enable more warnings in cmake script

0.8
Bruno Van de Velde 2018-05-10 14:15:19 +02:00
parent 3a08eb5750
commit 856361dd42
2 changed files with 19 additions and 7 deletions

View File

@ -5,7 +5,7 @@ else()
endif() endif()
# Use new RPATH behavior on macOS # Use new RPATH behavior on macOS
if(NOT CMAKE_VERSION VERSION_LESS 3.9) if(POLICY CMP0068)
cmake_policy(SET CMP0068 NEW) cmake_policy(SET CMP0068 NEW)
endif() endif()

View File

@ -8,12 +8,24 @@ endmacro()
# Set the compile options used by all targets # Set the compile options used by all targets
function(tgui_set_global_compile_flags target) function(tgui_set_global_compile_flags target)
if(TGUI_COMPILER_GCC OR TGUI_COMPILER_CLANG) if(TGUI_COMPILER_MSVC)
target_compile_options(${target} PRIVATE -Wall) target_compile_options(${target} PRIVATE /W4)
target_compile_options(${target} PRIVATE -Wextra) else()
target_compile_options(${target} PRIVATE -Wshadow) target_compile_options(${target}
target_compile_options(${target} PRIVATE -Wno-long-long) PRIVATE
target_compile_options(${target} PRIVATE -pedantic) -Wall
-Wextra
-Wshadow
-Wnon-virtual-dtor
-Wold-style-cast
-Wcast-align
-Wunused
-Woverloaded-virtual
-Wpedantic
-Wlogical-op
-Wuseless-cast
-Wdouble-promotion
-Wformat=2)
set_target_properties(${target} PROPERTIES CXX_STANDARD_REQUIRED ON) set_target_properties(${target} PROPERTIES CXX_STANDARD_REQUIRED ON)
set_target_properties(${target} PROPERTIES CXX_EXTENSIONS OFF) set_target_properties(${target} PROPERTIES CXX_EXTENSIONS OFF)