Commit ebafacb0 authored by Ing. Jan Trávníček's avatar Ing. Jan Trávníček

cmake: add more warnings

parent 304ae28d
......@@ -20,9 +20,21 @@ if(NOT(CMAKE_BUILD_TYPE MATCHES RELEASE) AND BACKTRACE_EXISTS)
endif()
# Add some basic compiler options
add_compile_options(-Wall -Wextra -pedantic -pipe -Woverloaded-virtual -Wshadow -Wpointer-arith -Wcast-qual -Wdelete-non-virtual-dtor -Wredundant-decls -Wold-style-cast)
add_compile_options(-Wall -Wextra -pedantic -pipe -Wshadow )
add_compile_options(-Wnon-virtual-dtor -Wcast-align -Wunused -Woverloaded-virtual -Wnull-dereference -Wdouble-promotion -Wformat=2 -Wpointer-arith -Wcast-qual -Wdelete-non-virtual-dtor -Wredundant-decls -Wold-style-cast)
set(CMAKE_CXX_FLAGS_DEBUG "-Werror ${CMAKE_CXX_FLAGS_DEBUG}")
# -Wsign-conversion -Wconversion
if(${CMAKE_CXX_COMPILER_ID} MATCHES "(GNU)")
add_compile_options(-Wlogical-op)
# -Wuseless-cast # buggy; compains about creation of a temporary...
# -Wduplicated-cond -Wduplicated-branches # todo
endif ()
if(${CMAKE_CXX_COMPILER_ID} MATCHES "(Clang)")
# add_compile_options(-Wlifetime) # enable once it becomes available
endif ()
# Use -Og (or -O0) in Debug
if(CMAKE_BUILD_TYPE MATCHES DEBUG)
CHECK_CXX_COMPILER_FLAG("-Og" COMPILER_HAS_OG)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment