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/10/30 19:57:07 UTC

qpid-proton git commit: PROTON-1664: Ensure that C++ examples build standalone

Repository: qpid-proton
Updated Branches:
  refs/heads/master ae1f143d2 -> 9cd879eba


PROTON-1664: Ensure that C++ examples build standalone


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

Branch: refs/heads/master
Commit: 9cd879eba69e7bf4182d24f72b74110252a910ce
Parents: ae1f143
Author: Andrew Stitcher <as...@apache.org>
Authored: Mon Oct 30 15:56:34 2017 -0400
Committer: Andrew Stitcher <as...@apache.org>
Committed: Mon Oct 30 15:56:34 2017 -0400

----------------------------------------------------------------------
 examples/cpp/CMakeLists.txt | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/9cd879eb/examples/cpp/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/examples/cpp/CMakeLists.txt b/examples/cpp/CMakeLists.txt
index 3967fc1..018a03e 100644
--- a/examples/cpp/CMakeLists.txt
+++ b/examples/cpp/CMakeLists.txt
@@ -21,6 +21,8 @@ cmake_minimum_required (VERSION 2.8.7)
 enable_language(CXX)
 
 find_package(ProtonCpp REQUIRED)
+set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
+find_package(Threads)
 
 include_directories(${ProtonCpp_INCLUDE_DIRS})
 link_libraries(${ProtonCpp_LIBRARIES})
@@ -68,12 +70,19 @@ if(HAS_CPP11)
   # Examples that require C++11
   foreach(example
       scheduled_send
-      service_bus
-      multithreaded_client
-      multithreaded_client_flow_control
-      )
+      service_bus)
     add_executable(${example} ${example}.cpp)
   endforeach()
+
+  # Examples that use threads directly
+  if (Threads_FOUND)
+    foreach(example
+        multithreaded_client
+        multithreaded_client_flow_control)
+      add_executable(${example} ${example}.cpp)
+      target_link_libraries(${example} ${CMAKE_THREAD_LIBS_INIT})
+    endforeach()
+  endif()
 endif()
 
 # Add a test with the correct environment to find test executables and valgrind.


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