# This file contains compile flags and general build configuration for Quassel
#
-# (C) 2014-2018 by the Quassel Project <devel@quassel-irc.org>
+# (C) 2014-2019 by the Quassel Project <devel@quassel-irc.org>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
-Wundef
-Wvla
-Werror=return-type
+ "$<$<BOOL:${FATAL_WARNINGS}>:-Werror>"
-Wno-unknown-pragmas
"$<$<NOT:$<CONFIG:Debug>>:-U_FORTIFY_SOURCE;-D_FORTIFY_SOURCE=2>"
)
add_definitions(-DWIN32_LEAN_AND_MEAN -DUNICODE -D_UNICODE -D_USE_MATH_DEFINES -DNOMINMAX)
# Compile options
- add_compile_options(/EHsc)
+ add_compile_options(
+ /EHsc
+ "$<$<BOOL:${FATAL_WARNINGS}>:/WX>"
+ )
# Increase warning level on MSVC
# CMake puts /W3 in CMAKE_CXX_FLAGS which will be appended later, so we need to replace
- message(STATUS "CXX ${CMAKE_CXX_FLAGS} REL ${CMAKE_CXX_FLAGS_RELEASE} DEB ${CMAKE_CXX_FLAGS_DEBUG}")
string(REPLACE "/W3" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
# Silence annoying/useless warnings