MACRO(ENABLE_IF_LINKS _variable _flag)
STRING(STRIP "${_flag}" _flag_stripped)
- STRING(REGEX REPLACE "^-" "" _flag_name "${_flag_stripped}")
- STRING(REPLACE "," "" _flag_name "${_flag_name}")
- STRING(REPLACE "-" "_" _flag_name "${_flag_name}")
-
IF(NOT "${_flag_stripped}" STREQUAL "")
+ STRING(REGEX REPLACE "^-" "" _flag_name "${_flag_stripped}")
+ STRING(REPLACE "," "" _flag_name "${_flag_name}")
+ STRING(REPLACE "--" "__" _flag_name "${_flag_name}")
ADD_FLAGS(CMAKE_REQUIRED_FLAGS "${_flag_stripped}")
- CHECK_CXX_SOURCE_COMPILES(
- "
- int main() { return 0; }
- "
- DEAL_II_HAVE_FLAG_${_flag_name}
- )
+ CHECK_CXX_COMPILER_FLAG(
+ ""
+ DEAL_II_HAVE_FLAG_${_flag_name}
+ )
STRIP_FLAG(CMAKE_REQUIRED_FLAGS "${_flag_stripped}")
IF(DEAL_II_HAVE_FLAG_${_flag_name})
SET(${_variable} "${${_variable}} ${_flag_stripped}")
ENDIF()
ENDIF()
ENDMACRO()
-
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}")
CHECK_CXX_COMPILER_FLAG(
"${_flag_stripped}"
DEAL_II_HAVE_FLAG_${_flag_name}