opm-simulators/cmake/Modules/UseWarnings.cmake
Roland Kaufmann b13f9d251b Fix logic bug and make language explicit
The operator precedence in CMake can be surprising, so add parenthesis
to make in unambigious. Also, make it more explicit from which language
we get the default options. (They are all set from the settings given
for C++; why would have different optimization options for C and C++?)
2013-09-24 15:39:46 +02:00

15 lines
394 B
CMake

# - Turn on warnings when compiling
include (AddOptions)
include (UseCompVer)
is_compiler_gcc_compatible ()
if (CXX_COMPAT_GCC)
# default warnings flags, if not set by user
set_default_option (CXX _warn_flag "-Wall" "(^|\ )-W")
if (_warn_flag)
message (STATUS "All warnings enabled: ${_warn_flag}")
add_options (ALL_LANGUAGES ALL_BUILDS "${_warn_flag}")
endif (_warn_flag)
endif ()