Fixes CMake caching issues on Windows.

This commit is contained in:
Christian Parpart 2019-11-27 12:11:57 +01:00
parent 89b1a42b5c
commit 5bf2eab6a4

View File

@ -10,7 +10,9 @@ include(CheckCXXCompilerFlag)
# #
function(eth_add_cxx_compiler_flag_if_supported FLAG) function(eth_add_cxx_compiler_flag_if_supported FLAG)
# Remove leading - or / from the flag name. # Remove leading - or / from the flag name.
string(REGEX REPLACE "^-|/" "" name ${FLAG}) string(REGEX REPLACE "^[-/]" "" name ${FLAG})
# Deletes any ':' because it's invalid variable names.
string(REGEX REPLACE ":" "" name ${name})
check_cxx_compiler_flag(${FLAG} ${name}) check_cxx_compiler_flag(${FLAG} ${name})
if(${name}) if(${name})
add_compile_options(${FLAG}) add_compile_options(${FLAG})