You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ac...@apache.org on 2016/04/28 19:50:24 UTC

qpid-proton git commit: PROTON-1046: c++: auto build/test C++11 code when possible.

Repository: qpid-proton
Updated Branches:
  refs/heads/master d4de312bd -> a39d6ac5e


PROTON-1046: c++: auto build/test C++11 code when possible.

Use compile tests to determine if C++11 code and tests are be built.

NOTE: To change the compiler standard (CMAKE_CXX_COMPILE_FLAGS or CMAKE_CXX_STANDARD)
you must delete CMakeCache and start over as it is equivalent to changing compiler.


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

Branch: refs/heads/master
Commit: a39d6ac5ef700dcf74dd993755145ca7cfd74dfc
Parents: d4de312
Author: Alan Conway <ac...@redhat.com>
Authored: Thu Apr 28 13:48:40 2016 -0400
Committer: Alan Conway <ac...@redhat.com>
Committed: Thu Apr 28 13:48:40 2016 -0400

----------------------------------------------------------------------
 examples/cpp/CMakeLists.txt          | 7 +++++--
 proton-c/bindings/cpp/CMakeLists.txt | 6 ++----
 proton-c/bindings/cpp/cpp.cmake      | 2 --
 3 files changed, 7 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/a39d6ac5/examples/cpp/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/examples/cpp/CMakeLists.txt b/examples/cpp/CMakeLists.txt
index 5804573..2cb258f 100644
--- a/examples/cpp/CMakeLists.txt
+++ b/examples/cpp/CMakeLists.txt
@@ -61,15 +61,18 @@ add_test(NAME cpp_container_example_test
   COMMAND ${env_py} -- "PATH=${test_path}" ${VALGRIND_ENV} ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/example_test.py -v ContainerExampleTest)
 
 # TODO aconway 2016-04-26: need portable MT and IO examples.
-if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND BUILD_CPP_MT)
+if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND HAS_CPP11)
   set(controller_src mt/epoll_controller.cpp)
   foreach(example
       broker
       )
     add_executable(mt_${example} mt/${example}.cpp ${controller_src})
     target_link_libraries(mt_${example} pthread)
-    set_target_properties(mt_${example} PROPERTIES CXX_STANDARD 11)
   endforeach()
+
   add_test(NAME cpp_mt_example_test
     COMMAND ${env_py} -- "PATH=${test_path}" ${VALGRIND_ENV} ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/example_test.py -v MtBrokerTest)
 endif()
+
+
+

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/a39d6ac5/proton-c/bindings/cpp/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/CMakeLists.txt b/proton-c/bindings/cpp/CMakeLists.txt
index 6b1459e..4ef3097 100644
--- a/proton-c/bindings/cpp/CMakeLists.txt
+++ b/proton-c/bindings/cpp/CMakeLists.txt
@@ -80,7 +80,8 @@ set(qpid-proton-cpp-source
   src/value.cpp
   )
 
-if (BUILD_CPP_MT)
+if (HAS_CPP11)
+  message("Enable C++11 extensions")
   list(APPEND qpid-proton-cpp-source src/controller.cpp)
 endif()
 
@@ -103,9 +104,6 @@ set_target_properties (
   SOVERSION "${PN_LIB_SOMAJOR}"
   LINK_FLAGS "${CATCH_UNDEFINED} ${LTO}"
   )
-if (BUILD_CPP_MT)
-  set_target_properties(qpid-proton-cpp PROPERTIES CXX_STANDARD 11)
-endif()
 
 ## Install
 

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/a39d6ac5/proton-c/bindings/cpp/cpp.cmake
----------------------------------------------------------------------
diff --git a/proton-c/bindings/cpp/cpp.cmake b/proton-c/bindings/cpp/cpp.cmake
index f89cc0d..51980d7 100644
--- a/proton-c/bindings/cpp/cpp.cmake
+++ b/proton-c/bindings/cpp/cpp.cmake
@@ -32,6 +32,4 @@ if (CMAKE_CXX_COMPILER)
     add_definitions(-DPN_CPP_HAS_STD_PTR=1)
   endif()
   check_cxx_source_compiles("#if defined(__cplusplus) && __cplusplus >= 201100\nint main(int, char**) { return 0; }\n#endif" HAS_CPP11)
-
-  option(BUILD_CPP_MT "Build C++ multi-thread extensions, requires C++11" ${HAS_CPP11})
 endif()


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