]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
CMake: Bugfix
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 27 Mar 2013 17:37:14 +0000 (17:37 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 27 Mar 2013 17:37:14 +0000 (17:37 +0000)
git-svn-id: https://svn.dealii.org/trunk@29082 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/cmake/macros/macro_enable_if_links.cmake
deal.II/cmake/setup_compiler_flags_gnu.cmake
deal.II/cmake/setup_compiler_flags_intel.cmake

index c12936568c4639b9fa6bc1d2098390e22d4987d2..e2d2a2b9e3711404a1c7ce148417e8f93e734e4e 100644 (file)
@@ -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})
index 365e3d5221a70070c09588b8f1c3106d115d03af..ae808667e3bbe3b29d314f6d5bcc896d294d2fcc 100644 (file)
@@ -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")
 
 
 #
index 1edd5a0ce362569b96bf010df1536d4a84a8440d..ac9808b05598c8afa4bff9e363efac8c325c4b1d 100644 (file)
@@ -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:

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.