Enable more warnings in cmake script
parent
3a08eb5750
commit
856361dd42
|
@ -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()
|
||||||
|
|
||||||
|
|
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue