[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 Jun 9 12:37:44 CDT 2011


branch "master" has been updated
       via  965d3574c20c1d144407613a501a9b0016646508 (commit)
      from  d5982f1b79d146f5c0b3947aa0acf93eb7be637f (commit)

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


- Log -----------------------------------------------------------------
commit 965d3574c20c1d144407613a501a9b0016646508
Author: David M. Lee <dlee at digium.com>
Date:   Tue Jun 7 14:45:32 2011 -0500

    Disable compilation for C++0x by default.
    
    Added a CMake flag 'ENABLE_CPP0X' to optionally enable C++0x.

diff --git a/AsteriskSCF.cmake b/AsteriskSCF.cmake
index 0766521..d039634 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -33,6 +33,12 @@
 #
 
 #
+# CMake variables (can be defined using -D on the cmake command line)
+# * ENABLE_CPP0X - Enables C++0x features in the compiler.  Will error out if
+#                  compiler does not support C++0x.
+#
+
+#
 # Coding/style guidelines:
 #
 # * Variables local to a function should be named using lowercase.
@@ -336,16 +342,21 @@ function(asterisk_scf_project NAME ICE_VERSION)
         endif()
     endif()
 
-    # Use a compiler test for GCC to see if C++0x is supported; enable it if found.
-    if(CMAKE_COMPILER_IS_GNUCXX)
-	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")
+    # If C++0x support is requested, use a compiler check to see if it is available
+    # C++0x was on by default, but we disabled it due to problems with
+    # Ubuntu 11.04.
+    # See http://bugs.launchpad.net/ubuntu/+source/boost1.42/+bug/776860
+    if(ENABLE_CPP0X)
+        if(CMAKE_COMPILER_IS_GNUCXX)
+            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(FATAL_ERROR "Compiler does not support C++0x")
+            endif()
         endif()
     endif()
 

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


-- 
asterisk-scf/release/cmake.git



More information about the asterisk-scf-commits mailing list