qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From astitc...@apache.org
Subject qpid-proton git commit: PROTON-1527: [C++ binding] Allow library to compiled as C++03 even if C++11 is available
Date Wed, 04 Oct 2017 20:33:00 GMT
Repository: qpid-proton
Updated Branches:
  refs/heads/master aece4ad2f -> 2e09b3658


PROTON-1527: [C++ binding] Allow library to compiled as C++03 even if C++11 is available


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/2e09b365
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/2e09b365
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/2e09b365

Branch: refs/heads/master
Commit: 2e09b3658648d7d76424eb7a5b5b6c2c2e804d1c
Parents: aece4ad
Author: Andrew Stitcher <astitcher@apache.org>
Authored: Wed Oct 4 16:25:50 2017 -0400
Committer: Andrew Stitcher <astitcher@apache.org>
Committed: Wed Oct 4 16:25:50 2017 -0400

----------------------------------------------------------------------
 proton-c/bindings/cpp/CMakeLists.txt | 36 ++++++++++++++++++++-----------
 1 file changed, 23 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/2e09b365/proton-c/bindings/cpp/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/CMakeLists.txt b/proton-c/bindings/cpp/CMakeLists.txt
index 9409d30..a028c98 100644
--- a/proton-c/bindings/cpp/CMakeLists.txt
+++ b/proton-c/bindings/cpp/CMakeLists.txt
@@ -17,9 +17,16 @@
 # under the License.
 #
 
+set (BUILD_CPP_03 OFF CACHE BOOL "Compile the C++ binding as C++03 even when C++11 is available")
+
 # This effectively checks for cmake version 3.1 or later
 if (DEFINED CMAKE_CXX_COMPILE_FEATURES)
-  set(CMAKE_CXX_STANDARD 11)
+  if (BUILD_CPP_03)
+    set(STD 98)
+  else ()
+    set(STD 11)
+  endif ()
+  set(CMAKE_CXX_STANDARD ${STD})
   set(CMAKE_CXX_EXTENSIONS OFF)
 # AStitcher 20170804: Disabled for present - work on this when Windows C++ works
 #  cmake_minimum_required(VERSION 3.1)
@@ -34,21 +41,24 @@ if (DEFINED CMAKE_CXX_COMPILE_FEATURES)
     include(cpp.cmake)
   endif()
 else ()
-  include(CheckCXXCompilerFlag)
-  # These flags work with GCC/Clang/SunPro compilers
-  check_cxx_compiler_flag("-std=c++11" ACCEPTS_CXX11)
-  check_cxx_compiler_flag("-std=c++0x" ACCEPTS_CXX0X)
-  if (ACCEPTS_CXX11)
-    set(CXX_STANDARD "-std=c++11")
-  elseif(ACCEPTS_CXX0X)
-    set(CXX_STANDARD "-std=c++0x")
-    include(cpp.cmake) # Compiler checks needed for C++0x as not all C++11 may be supported
-  else()
-    include(cpp.cmake) # Compiler checks needed as we have no idea whats going on here!
+  if (BUILD_CPP_03)
+    set(CXX_STANDARD "-std=c++98")
+  else ()
+    include(CheckCXXCompilerFlag)
+    # These flags work with GCC/Clang/SunPro compilers
+    check_cxx_compiler_flag("-std=c++11" ACCEPTS_CXX11)
+    check_cxx_compiler_flag("-std=c++0x" ACCEPTS_CXX0X)
+    if (ACCEPTS_CXX11)
+      set(CXX_STANDARD "-std=c++11")
+    elseif(ACCEPTS_CXX0X)
+      set(CXX_STANDARD "-std=c++0x")
+      include(cpp.cmake) # Compiler checks needed for C++0x as not all C++11 may be supported
+    else()
+      include(cpp.cmake) # Compiler checks needed as we have no idea whats going on here!
+    endif()
   endif()
 endif ()
 
-
 include_directories(
   "${CMAKE_SOURCE_DIR}/proton-c/include"
   "${CMAKE_CURRENT_SOURCE_DIR}/include"


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message