From: Matthias Maier Date: Wed, 1 Oct 2014 13:10:45 +0000 (+0200) Subject: CMake: Bugfix: Also sanitize (cpp) macros in enable_if_links X-Git-Tag: v8.2.0-rc1~115^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dd94143f6fa6b8da1ebb9caca70bf3c67d9f8f32;p=dealii.git CMake: Bugfix: Also sanitize (cpp) macros in enable_if_links --- 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}