[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
Wed Apr 20 09:15:58 CDT 2011


branch "master" has been updated
       via  a6ac4e1250366094c75509ff261fd4c45a499745 (commit)
      from  ab619613d15ba05480c2f5b8fb811f21779afd60 (commit)

Summary of changes:
 AsteriskSCF.cmake |   31 ++++++++++++++++---------------
 1 files changed, 16 insertions(+), 15 deletions(-)


- Log -----------------------------------------------------------------
commit a6ac4e1250366094c75509ff261fd4c45a499745
Author: Kevin P. Fleming <kpfleming at digium.com>
Date:   Wed Apr 20 09:14:44 2011 -0500

    Use the CheckCXXCompilerFlag macro included with Cmake to test for
    C++0x support and -Wlogical-op support.
    
    Re-enable -Wunused-parameter now that we have disabled -Werror; when we get
    all the warnings resolved, -Werror will return.

diff --git a/AsteriskSCF.cmake b/AsteriskSCF.cmake
index be09ffd..8eab9ad 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -236,20 +236,16 @@ function(asterisk_scf_project NAME ICE_VERSION)
         endif()
     endif()
 
-    # Use a compile test to see if shared_ptr is supported. If present then C++0x support exists.
+    # Use a compiler test for GCC to see if C++0x is supported; enable it if found.
     if(CMAKE_COMPILER_IS_GNUCXX)
-        try_compile(SHARED_PTR_PRESENT
-	            ${CMAKE_BINARY_DIR}
-		    ${CMAKE_SOURCE_DIR}/cmake/tests/SharedPtr.cpp
-		    COMPILE_DEFINITIONS "-std=c++0x"
-		    OUTPUT_VARIABLE OUTPUT
-		    )
-        if(SHARED_PTR_PRESENT)
-            message(STATUS "Support for C++0x Enabled")
-            add_definitions("-DCPP_ZEROX_SUPPORT")
-	    list(APPEND cxx_flags "-std=c++0x")
+	include(CheckCXXCompilerFlag)
+	CHECK_CXX_COMPILER_FLAG(-std=c++0x HAVE_STD_CPP0X)
+	if(HAVE_STD_CPP0X)
+          add_definitions("-DCPP_ZEROX_SUPPORT")
+	  list(APPEND cxx_flags "-std=c++0x")
+          message(STATUS "Support for C++0x Enabled")
         else()
-            message(STATUS "Support for C++0x Disabled")
+          message(STATUS "Support for C++0x Disabled")
         endif()
     endif()
 
@@ -260,9 +256,14 @@ function(asterisk_scf_project NAME ICE_VERSION)
 
     if(CMAKE_COMPILER_IS_GNUCXX)
         list(APPEND cxx_flags ${ICE_CXX_FLAGS})
-        # TODO - add -Wlogical-op if and only if supported
-        # TODO - remove -Wno-unused-parameter when we get the Ice headers straightened out
-        list(APPEND cxx_flags_debug "-Wshadow" "-Wmissing-format-attribute" "-Wformat=2" "-Wall" "-Wextra" "-Wpointer-arith" "-Wconversion" "-Wno-unused-parameter" "-g3")
+        list(APPEND cxx_flags_debug "-Wall" "-Wextra" "-g3")
+        list(APPEND cxx_flags_debug "-Wshadow" "-Wmissing-format-attribute" "-Wformat=2" "-Wpointer-arith" "-Wconversion")
+	include(CheckCXXCompilerFlag)
+	CHECK_CXX_COMPILER_FLAG(-Wlogical-op HAVE_W_LOGICAL_OP)
+	if(HAVE_W_LOGICAL_OP)
+	  list(APPEND cxx_flags_debug "-Wlogical-op")
+	endif()
+	#list(APPEND cxx_flags_debug "-Werror")
 	list(APPEND cxx_flags_profile "-ftest-coverage" "-fprofile-arcs")
     endif()
 

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


-- 
asterisk-scf/release/cmake.git



More information about the asterisk-scf-commits mailing list