[asterisk-scf-commits] asterisk-scf/release/cmake.git branch "master" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Thu Jan 20 07:22:52 CST 2011


branch "master" has been updated
       via  a7e7b7d2e766af7d7a437441cfabfa9fe8b394d1 (commit)
      from  66640ddef1ebc5209a2f4cf4660b30ec9c21b77a (commit)

Summary of changes:
 AsteriskSCF.cmake |   44 +++++++++++++++++++-------------------------
 1 files changed, 19 insertions(+), 25 deletions(-)


- Log -----------------------------------------------------------------
commit a7e7b7d2e766af7d7a437441cfabfa9fe8b394d1
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Thu Jan 20 07:21:00 2011 -0600

    Don't set compiler/linker flags variables in the cache; they should be
    set in the current directory scope to preserve any values that the platform
    code (included with CMake) stored in them.

diff --git a/AsteriskSCF.cmake b/AsteriskSCF.cmake
index e85b9a5..f980a89 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -150,6 +150,14 @@ macro(set_cache_var)
     set(${ARGV} CACHE INTERNAL Bob FORCE)
 endmacro()
 
+macro(append_to_var VAR)
+    unset(_altv)
+    foreach(item ${ARGN})
+        set(_altv "${_altv} ${item}")
+    endforeach()
+    set(${VAR} "${${VAR}} ${_altv}" PARENT_SCOPE)
+endmacro()
+
 macro(set_cache_var_list VAR LIST TYPE DESCRIPTION)
     unset(_scvl)
     foreach(item IN LISTS ${LIST})
@@ -236,31 +244,17 @@ function(asterisk_scf_project NAME ICE_VERSION)
 	list(APPEND cxx_flags_profile "-ftest-coverage" "-fprofile-arcs")
     endif()
 
-    list(APPEND c_flags_profile ${c_flags_debug})
-    set_cache_var_list(CMAKE_C_FLAGS c_flags STRING
-                       "Flags used by the compiler during all builds.")
-    set_cache_var_list(CMAKE_C_FLAGS_DEBUG c_flags_debug STRING
-                       "Flags used by the compiler during debug builds.")
-    set_cache_var_list(CMAKE_C_FLAGS_PROFILE c_flags_profile STRING
-                       "Flags used by the compiler during profile builds.")
-    mark_as_advanced(CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_PROFILE)
-
-    list(APPEND cxx_flags_profile ${cxx_flags_debug})
-    set_cache_var_list(CMAKE_CXX_FLAGS cxx_flags STRING
-                       "Flags used by the compiler during all builds.")
-    set_cache_var_list(CMAKE_CXX_FLAGS_DEBUG cxx_flags_debug STRING
-                       "Flags used by the compiler during debug builds.")
-    set_cache_var_list(CMAKE_CXX_FLAGS_PROFILE cxx_flags_profile STRING
-                       "Flags used by the compiler during profile builds.")
-    mark_as_advanced(CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_PROFILE)
-
-    set_cache_var_list(CMAKE_EXE_LINKER_FLAGS linker_flags STRING
-                       "Flags used by the linker for standalone components during all builds.")
-    set_cache_var_list(CMAKE_MODULE_LINKER_FLAGS linker_flags STRING
-                       "Flags used by the linker for modules during all builds.")
-    set_cache_var_list(CMAKE_SHARED_LINKER_FLAGS linker_flags STRING
-                       "Flags used by the linker for shared libraries during all builds.")
-    mark_as_advanced(CMAKE_EXE_LINKER_FLAGS CMAKE_MODULE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
+    append_to_var(CMAKE_C_FLAGS ${c_flags})
+    append_to_var(CMAKE_C_FLAGS_DEBUG ${c_flags_debug})
+    append_to_var(CMAKE_C_FLAGS_PROFILE ${c_flags_profile} ${c_flags_debug})
+
+    append_to_var(CMAKE_CXX_FLAGS ${cxx_flags})
+    append_to_var(CMAKE_CXX_FLAGS_DEBUG ${cxx_flags_debug})
+    append_to_var(CMAKE_CXX_FLAGS_PROFILE ${cxx_flags_profile} ${cxx_flags_debug})
+
+    append_to_var(CMAKE_EXE_LINKER_FLAGS ${linker_flags})
+    append_to_var(CMAKE_MODULE_LINKER_FLAGS ${linker_flags})
+    append_to_var(CMAKE_SHARED_LINKER_FLAGS ${linker_flags})
 
     message(STATUS "Passed requirement checks for CXX components")
 endfunction()

-----------------------------------------------------------------------


-- 
asterisk-scf/release/cmake.git



More information about the asterisk-scf-commits mailing list