[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
Tue Nov 30 11:23:57 CST 2010


branch "master" has been updated
       via  b19a7d9c985a79bca1580b57190cb8b7bd11e203 (commit)
       via  9c9a5dfcac3ae1eb745dc0c2905221d3d276d2a9 (commit)
      from  81af25d5567e8b542f7068ad9d94affba8a72fe7 (commit)

Summary of changes:
 AsteriskSCF.cmake |   28 ++++++++++++++++++----------
 1 files changed, 18 insertions(+), 10 deletions(-)


- Log -----------------------------------------------------------------
commit b19a7d9c985a79bca1580b57190cb8b7bd11e203
Author: David M. Lee <dlee at digium.com>
Date:   Tue Nov 30 11:21:44 2010 -0600

    Minimize cmake warning noise.
    
    I'm a bit smarter than I was when I wrote that bit of script.  Now the
    warning that profile builds aren't supported on Windows is only printed
    if you attempt to build a profile build on Windows.

diff --git a/AsteriskSCF.cmake b/AsteriskSCF.cmake
index 89de85d..e347b90 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -60,7 +60,7 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules")
 # If a build type has not been explicitly specified then use debug
 if(NOT CMAKE_BUILD_TYPE)
     set(CMAKE_BUILD_TYPE Debug CACHE STRING
-        "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
+        "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel Profile."
         FORCE)
 endif()
 
@@ -84,9 +84,11 @@ if(CMAKE_COMPILER_IS_GNUCXX)
         CACHE STRING "Flags used by the compiler during debug builds." FORCE)
 endif()
 
-if(WIN32)
-    message(WARNING "Profile builds not supported")
-else()
+if(WIN32 AND ${CMAKE_BUILD_TYPE} STREQUAL profile)
+    message(FATAL_ERROR "Profile builds not supported")
+endif()
+
+if(NOT WIN32)
     message(STATUS "Adding profile flags")
     set(CMAKE_C_FLAGS_PROFILE
         "${CMAKE_C_FLAGS_DEBUG} -ftest-coverage -fprofile-arcs"

commit 9c9a5dfcac3ae1eb745dc0c2905221d3d276d2a9
Author: David M. Lee <dlee at digium.com>
Date:   Tue Nov 30 11:15:12 2010 -0600

    Consistently set debug compilation flags.
    
    Turns out CMake will accept debug, Debug, or DeBuG as the same build
    type.
    * tolower the CMAKE_BUILD_TYPE, so we can strequal it reliably.
    * set compilation flags using CMAKE_C_FLAGS_DEBUG and
      CMAKE_CXX_FLAGS_DEBUG

diff --git a/AsteriskSCF.cmake b/AsteriskSCF.cmake
index 641ec29..89de85d 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -64,6 +64,10 @@ if(NOT CMAKE_BUILD_TYPE)
         FORCE)
 endif()
 
+# since Debug, debug and DeBuG all mean the same thing to cmake, tolower it
+# for consistency
+string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE)
+
 # threading support required
 find_package(Threads REQUIRED)
 
@@ -71,6 +75,14 @@ if(CMAKE_SYSTEM MATCHES "SunOS.*")
     set(CMAKE_CXX_FLAGS "-pthreads ")
 endif()
 
+if(CMAKE_COMPILER_IS_GNUC)
+    set(CMAKE_C_FLAGS_DEBUG "-Werror -Wall -g3"
+        CACHE STRING "Flags used by the compiler during debug builds." FORCE)
+endif()
+if(CMAKE_COMPILER_IS_GNUCXX)
+    set(CMAKE_CXX_FLAGS_DEBUG "-Werror -Wall -g3"
+        CACHE STRING "Flags used by the compiler during debug builds." FORCE)
+endif()
 
 if(WIN32)
     message(WARNING "Profile builds not supported")
@@ -303,9 +315,6 @@ function(asterisk_scf_project NAME ICE_VERSION)
             message(STATUS "Passed requirement checks for CSharp components")
         elseif(l STREQUAL "CXX")
             message(STATUS "Performing requirement checks for CXX components")
-            if(CMAKE_COMPILER_IS_GNUCXX)
-	        set(CMAKE_CXX_FLAGS_DEBUG "-g3 -Wall")
-            endif()
             find_ICE_CXX()
             find_ICE_CXX_library(Ice)
             find_ICE_CXX_library(IceUtil)
@@ -740,9 +749,6 @@ function(asterisk_scf_component_add_file COMPONENT)
     set(file_list ${${COMPONENT}_SOURCES})
     foreach(file ${ARGN})
         list(APPEND file_list ${CMAKE_CURRENT_SOURCE_DIR}/${file})
-        if(ASTERISK_SCF_${COMPONENT}_LANG STREQUAL "CXX" AND CMAKE_COMPILER_IS_GNUCXX AND CMAKE_BUILD_TYPE STREQUAL Debug)
-            set_source_files_properties(${file} COMPILE_FLAGS "-Wall -Werror")
-        endif()
     endforeach()
     list(REMOVE_DUPLICATES file_list)
     set(${COMPONENT}_SOURCES ${file_list} PARENT_SCOPE)

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


-- 
asterisk-scf/release/cmake.git



More information about the asterisk-scf-commits mailing list