You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by as...@apache.org on 2017/12/10 21:32:50 UTC
qpid-proton git commit: PROTON-1654: [C++ binding] Fix building
examples on VS 2010
Repository: qpid-proton
Updated Branches:
refs/heads/master 2b033949c -> 413e09375
PROTON-1654: [C++ binding] Fix building examples on VS 2010
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/413e0937
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/413e0937
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/413e0937
Branch: refs/heads/master
Commit: 413e09375c21b87eab59c1ee31c63d336f89ba49
Parents: 2b03394
Author: Andrew Stitcher <as...@apache.org>
Authored: Sun Dec 10 15:27:29 2017 -0500
Committer: Andrew Stitcher <as...@apache.org>
Committed: Sun Dec 10 16:22:26 2017 -0500
----------------------------------------------------------------------
examples/cpp/CMakeLists.txt | 22 +++++++++++++++++++---
1 file changed, 19 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/413e0937/examples/cpp/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/examples/cpp/CMakeLists.txt b/examples/cpp/CMakeLists.txt
index 8768f71..0019355 100644
--- a/examples/cpp/CMakeLists.txt
+++ b/examples/cpp/CMakeLists.txt
@@ -28,6 +28,21 @@ include_directories(${ProtonCpp_INCLUDE_DIRS})
link_libraries(${ProtonCpp_LIBRARIES})
add_definitions(${ProtonCpp_DEFINITIONS})
+
+macro (has_cxx_features result)
+set(${result} OFF)
+if (DEFINED CMAKE_CXX_COMPILE_FEATURES)
+ set(${result} ON)
+ foreach(feature ${ARGN})
+ list(FIND CMAKE_CXX_COMPILE_FEATURES cxx_${feature} N)
+ if (N EQUAL -1)
+ set(${result} OFF)
+ break()
+ endif()
+ endforeach()
+endif()
+endmacro()
+
set (BUILD_CPP_03 OFF CACHE BOOL "Compile 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)
@@ -35,7 +50,8 @@ if (DEFINED CMAKE_CXX_COMPILE_FEATURES)
set(STD 98)
else ()
set(STD 11)
- set(HAS_CPP11 ON)
+ has_cxx_features(HAS_ENOUGH_CPP11 lambdas variadic_templates)
+ message(STATUS "Compiling C++11 examples: ${HAS_ENOUGH_CPP11}")
endif ()
set(CMAKE_CXX_STANDARD ${STD})
set(CMAKE_CXX_EXTENSIONS OFF)
@@ -66,7 +82,7 @@ foreach(example
add_executable(${example} ${example}.cpp)
endforeach()
-if(HAS_CPP11)
+if(HAS_ENOUGH_CPP11)
# Examples that require C++11
foreach(example
scheduled_send
@@ -93,7 +109,7 @@ macro(add_cpp_test name)
set(test_path "$<TARGET_FILE_DIR:broker>:$ENV{PATH}")
endif(WIN32)
set(run_env ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/proton-c/env.py ${EXAMPLE_ENV})
- add_test(NAME ${name} COMMAND ${run_env} "PATH=${test_path}" ${VALGRIND_ENV} "HAS_CPP11=${HAS_CPP11}" -- ${ARGN})
+ add_test(NAME ${name} COMMAND ${run_env} "PATH=${test_path}" ${VALGRIND_ENV} "HAS_CPP11=${HAS_ENOUGH_CPP11}" -- ${ARGN})
endmacro()
add_cpp_test(cpp-example-container ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/example_test.py -v ContainerExampleTest)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org