aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2021-08-26 21:11:37 -0400
committerluigi1111 <luigi1111w@gmail.com>2021-08-26 21:11:37 -0400
commit4ada08ad9abc42ae126d773ff44e3abe476ad7ea (patch)
tree5ef9d90f936c32115cf7d31a7132898ce92a018b
parentMerge pull request #7881 (diff)
parentCMake: document -Werror for add_c_flag_if_supported() from #7718 (diff)
downloadmonero-4ada08ad9abc42ae126d773ff44e3abe476ad7ea.tar.xz
Merge pull request #7847
0a021c3 CMake: document -Werror for add_c_flag_if_supported() from #7718 (mj-xmr)
-rw-r--r--CMakeLists.txt2
1 files changed, 2 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f8af45f4b..d06729931 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -106,6 +106,8 @@ function (die msg)
endfunction ()
function (add_c_flag_if_supported flag var)
+ # Prepending the flag with -Werror will only add the flag,
+ # if it doesn't result in generation of a warning of using a flag unknown to the compiler.
set(TMP "-Werror ${flag}")
string(REGEX REPLACE "[- ]" "_" supported ${TMP}_c)
check_c_compiler_flag(${TMP} ${supported})