[asterisk-scf-commits] asterisk-scf/integration/cmake.git branch "natty-fix" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Tue Jun 7 16:39:38 CDT 2011


branch "natty-fix" has been updated
       via  161acb6eae8ffd6cffc18861bd2657dee986739f (commit)
      from  35629a8e8ffa991eca51ebc7ad8540a6d758bbe7 (commit)

Summary of changes:
 AsteriskSCF.cmake     |   43 +++++++++++++++++++++----------------------
 tests/BoostThread.cpp |   27 ---------------------------
 2 files changed, 21 insertions(+), 49 deletions(-)
 delete mode 100644 tests/BoostThread.cpp


- Log -----------------------------------------------------------------
commit 161acb6eae8ffd6cffc18861bd2657dee986739f
Author: David M. Lee <dlee at digium.com>
Date:   Tue Jun 7 16:34:17 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 178118c..cc51ae6 100644
--- a/AsteriskSCF.cmake
+++ b/AsteriskSCF.cmake
@@ -33,6 +33,12 @@
 #
 
 #
+# CMake variables (can be define 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,28 +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)
-
-        # on Ubuntu 11.04, the boost-1.42 headers don't compile when c++0x
-        # is enabled.
-        # See http://bugs.launchpad.net/ubuntu/+source/boost1.42/+bug/776860
-        if(HAVE_STD_CPP0X)
-            message(STATUS "Performing Test BOOST_WORKS_WITH_CPP0X")
-            try_compile(BOOST_WORKS_WITH_CPP0X
-                ${CMAKE_BINARY_DIR}
-                ${CMAKE_SOURCE_DIR}/cmake/tests/BoostThread.cpp
-                COMPILE_DEFINITIONS -std=c++0x)
-        endif()
-
-        if(HAVE_STD_CPP0X AND BOOST_WORKS_WITH_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 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()
 
diff --git a/tests/BoostThread.cpp b/tests/BoostThread.cpp
deleted file mode 100644
index 47a3ad7..0000000
--- a/tests/BoostThread.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Asterisk SCF -- An open-source communications framework.
- *
- * Copyright (C) 2011, Digium, Inc.
- *
- * See http://www.asterisk.org for more information about
- * the Asterisk SCF project. Please do not directly contact
- * any of the maintainers of this project for assistance;
- * the project provides a web site, mailing lists and IRC
- * channels for your use.
- *
- * This program is free software, distributed under the terms of
- * the GNU General Public License Version 2. See the LICENSE.txt file
- * at the top of the source tree.
- */
-
-//
-// This file is used to ensure that <boost/thread.hpp> compiles with
-// out compilation flags.  This is needed because
-//   gcc-4.5 + C++0x + boost-1.42 = FAIL
-//   /usr/include/boost/thread/detail/thread.hpp: In function ‘boost::thread&& boost::move(boost::thread&&)’:
-//   /usr/include/boost/thread/detail/thread.hpp:349:16: error: invalid initialization of reference of type ‘boost::thread&&’ from expression of type ‘boost::thread’
-//
-
-#include <boost/thread.hpp>
-
-int main() {}

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


-- 
asterisk-scf/integration/cmake.git



More information about the asterisk-scf-commits mailing list