From dd94143f6fa6b8da1ebb9caca70bf3c67d9f8f32 Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Wed, 1 Oct 2014 15:10:45 +0200 Subject: [PATCH] CMake: Bugfix: Also sanitize (cpp) macros in enable_if_links --- cmake/macros/macro_enable_if_links.cmake | 3 ++- cmake/macros/macro_enable_if_supported.cmake | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cmake/macros/macro_enable_if_links.cmake b/cmake/macros/macro_enable_if_links.cmake index 21d33b31e7..9f6191b225 100644 --- a/cmake/macros/macro_enable_if_links.cmake +++ b/cmake/macros/macro_enable_if_links.cmake @@ -27,7 +27,8 @@ MACRO(ENABLE_IF_LINKS _variable _flag) IF(NOT "${_flag_stripped}" STREQUAL "") STRING(REGEX REPLACE "^-" "" _flag_name "${_flag_stripped}") STRING(REPLACE "," "" _flag_name "${_flag_name}") - STRING(REPLACE "--" "__" _flag_name "${_flag_name}") + STRING(REPLACE "-" "_" _flag_name "${_flag_name}") + STRING(REPLACE "+" "_" _flag_name "${_flag_name}") SET(_backup ${CMAKE_REQUIRED_LIBRARIES}) LIST(APPEND CMAKE_REQUIRED_LIBRARIES "${_flag_stripped}") CHECK_CXX_COMPILER_FLAG( diff --git a/cmake/macros/macro_enable_if_supported.cmake b/cmake/macros/macro_enable_if_supported.cmake index 198d90a8e3..1485fb57df 100644 --- a/cmake/macros/macro_enable_if_supported.cmake +++ b/cmake/macros/macro_enable_if_supported.cmake @@ -38,7 +38,7 @@ MACRO(ENABLE_IF_SUPPORTED _variable _flag) STRING(REGEX REPLACE "^-" "" _flag_name "${_flag_stripped}") STRING(REPLACE "," "" _flag_name "${_flag_name}") STRING(REPLACE "-" "_" _flag_name "${_flag_name}") - STRING(REPLACE "++" "__" _flag_name "${_flag_name}") + STRING(REPLACE "+" "_" _flag_name "${_flag_name}") CHECK_CXX_COMPILER_FLAG( "${_werror_string}${_flag_stripped}" DEAL_II_HAVE_FLAG_${_flag_name} -- 2.39.5