diff options
author | selsta <selsta@sent.at> | 2021-05-12 21:32:51 +0200 |
---|---|---|
committer | selsta <selsta@sent.at> | 2021-05-12 21:55:32 +0200 |
commit | 9c0e681dc9d3a5791ce03ca4005afe9d13727e75 (patch) | |
tree | 34904fecd94ccb99a312ce5276fc29dfb0741d38 /CMakeLists.txt | |
parent | Merge pull request #7669 (diff) | |
download | monero-9c0e681dc9d3a5791ce03ca4005afe9d13727e75.tar.xz |
cmake: treat warnings as error in compiler flag tests
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index e858b3aaf..9878a61db 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -106,16 +106,18 @@ function (die msg) endfunction () function (add_c_flag_if_supported flag var) - string(REPLACE "-" "_" supported ${flag}_c) - check_c_compiler_flag(${flag} ${supported}) + set(TMP "-Werror ${flag}") + string(REGEX REPLACE "[- ]" "_" supported ${TMP}_c) + check_c_compiler_flag(${TMP} ${supported}) if(${${supported}}) set(${var} "${${var}} ${flag}" PARENT_SCOPE) endif() endfunction() function (add_cxx_flag_if_supported flag var) - string(REPLACE "-" "_" supported ${flag}_cxx) - check_cxx_compiler_flag(${flag} ${supported}) + set(TMP "-Werror ${flag}") + string(REGEX REPLACE "[- ]" "_" supported ${TMP}_cxx) + check_cxx_compiler_flag(${TMP} ${supported}) if(${${supported}}) set(${var} "${${var}} ${flag}" PARENT_SCOPE) endif() |