mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
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++?)
15 lines
394 B
CMake
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 ()
|