diff options
author | selsta <selsta@sent.at> | 2021-05-12 21:32:51 +0200 |
---|---|---|
committer | selsta <selsta@sent.at> | 2021-08-01 15:47:05 +0200 |
commit | 2e9af2a1c8092c804bb2d32fba0c72fc5de47564 (patch) | |
tree | 07e4d3ba149b8599ce78cfab3ba71593f2dda051 | |
parent | wallet_api: fix typo in exportKeyImages (diff) | |
download | monero-2e9af2a1c8092c804bb2d32fba0c72fc5de47564.tar.xz |
cmake: treat warnings as error in compiler flag tests
-rw-r--r-- | CMakeLists.txt | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 66f4d0363..362ca8d56 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -71,16 +71,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() |