CMake: document -Werror for add_c_flag_if_supported() from #7718

This commit is contained in:
mj-xmr 2021-08-11 16:24:17 +02:00
parent ed506006d2
commit 0a021c3bd1
No known key found for this signature in database
GPG Key ID: C101BF94093451E0
1 changed files with 2 additions and 0 deletions

View File

@ -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})