From 0334c656aa7cda5585bba6495fbb9d97f9ddb873 Mon Sep 17 00:00:00 2001 From: maier Date: Wed, 27 Mar 2013 17:37:14 +0000 Subject: [PATCH] CMake: Bugfix git-svn-id: https://svn.dealii.org/trunk@29082 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/cmake/macros/macro_enable_if_links.cmake | 6 ++++-- deal.II/cmake/setup_compiler_flags_gnu.cmake | 3 +-- deal.II/cmake/setup_compiler_flags_intel.cmake | 3 +-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/deal.II/cmake/macros/macro_enable_if_links.cmake b/deal.II/cmake/macros/macro_enable_if_links.cmake index c12936568c..e2d2a2b9e3 100644 --- a/deal.II/cmake/macros/macro_enable_if_links.cmake +++ b/deal.II/cmake/macros/macro_enable_if_links.cmake @@ -27,12 +27,14 @@ MACRO(ENABLE_IF_LINKS _variable _flag) 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}") + SET(_backup ${CMAKE_REQUIRED_LIBRARIES}) + SET(CMAKE_REQUIRED_LIBRARIES "${_flag_stripped}") CHECK_CXX_COMPILER_FLAG( "" DEAL_II_HAVE_FLAG_${_flag_name} ) - STRIP_FLAG(CMAKE_REQUIRED_FLAGS "${_flag_stripped}") + SET(CMAKE_REQUIRED_LIBRARIES ${_backup}) + IF(DEAL_II_HAVE_FLAG_${_flag_name}) SET(${_variable} "${${_variable}} ${_flag_stripped}") STRING(STRIP "${${_variable}}" ${_variable}) diff --git a/deal.II/cmake/setup_compiler_flags_gnu.cmake b/deal.II/cmake/setup_compiler_flags_gnu.cmake index 365e3d5221..ae808667e3 100644 --- a/deal.II/cmake/setup_compiler_flags_gnu.cmake +++ b/deal.II/cmake/setup_compiler_flags_gnu.cmake @@ -58,8 +58,7 @@ ENABLE_IF_SUPPORTED(CMAKE_CXX_FLAGS "-fpic") # Check whether the -as-needed flag is available. If so set it to link # the deal.II library with it. # -# TODO: Disabled until ENABLE_IF_LINKS is properly implemented -#ENABLE_IF_LINKS(CMAKE_SHARED_LINKER_FLAGS "-Wl,--as-needed") +ENABLE_IF_LINKS(CMAKE_SHARED_LINKER_FLAGS "-Wl,--as-needed") # diff --git a/deal.II/cmake/setup_compiler_flags_intel.cmake b/deal.II/cmake/setup_compiler_flags_intel.cmake index 1edd5a0ce3..ac9808b055 100644 --- a/deal.II/cmake/setup_compiler_flags_intel.cmake +++ b/deal.II/cmake/setup_compiler_flags_intel.cmake @@ -42,8 +42,7 @@ ENABLE_IF_SUPPORTED(CMAKE_CXX_FLAGS "-fpic") # Check whether the -as-needed flag is available. If so set it to link # the deal.II library with it. # -# TODO: Disabled until ENABLE_IF_LINKS is properly implemented -#ENABLE_IF_LINKS(CMAKE_SHARED_LINKER_FLAGS "-Wl,--as-needed") +ENABLE_IF_LINKS(CMAKE_SHARED_LINKER_FLAGS "-Wl,--as-needed") # # Set ansi mode: -- 2.39.5