From 5bf2eab6a421f261e3c543468209929b5ca8135b Mon Sep 17 00:00:00 2001 From: Christian Parpart Date: Wed, 27 Nov 2019 12:11:57 +0100 Subject: [PATCH] Fixes CMake caching issues on Windows. --- cmake/EthCheckCXXCompilerFlag.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmake/EthCheckCXXCompilerFlag.cmake b/cmake/EthCheckCXXCompilerFlag.cmake index c6ed35b4e..3e62885fe 100644 --- a/cmake/EthCheckCXXCompilerFlag.cmake +++ b/cmake/EthCheckCXXCompilerFlag.cmake @@ -10,7 +10,9 @@ include(CheckCXXCompilerFlag) # function(eth_add_cxx_compiler_flag_if_supported FLAG) # 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}) if(${name}) add_compile_options(${FLAG})