You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by mm...@apache.org on 2021/02/06 06:02:16 UTC

[pulsar] branch master updated: [C++] Remove Boost::System runtime dependency (#9498)

This is an automated email from the ASF dual-hosted git repository.

mmerli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/master by this push:
     new dae8952  [C++] Remove Boost::System runtime dependency (#9498)
dae8952 is described below

commit dae8952e72634074fe7cceefb34ff6eb9c2f1952
Author: Matteo Merli <mm...@apache.org>
AuthorDate: Fri Feb 5 22:01:37 2021 -0800

    [C++] Remove Boost::System runtime dependency (#9498)
    
    * [C++] Remove Boost::System runtime dependency
    
    * Only remove it if Boost>=1.69
    
    * Fixed condition
    
    * Check for missing variables on older cmake versions
---
 pulsar-client-cpp/CMakeLists.txt | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/pulsar-client-cpp/CMakeLists.txt b/pulsar-client-cpp/CMakeLists.txt
index d4fdb8e..208069e 100644
--- a/pulsar-client-cpp/CMakeLists.txt
+++ b/pulsar-client-cpp/CMakeLists.txt
@@ -153,12 +153,23 @@ else()
     endif (USE_LOG4CXX)
 endif (LINK_STATIC)
 
+
+find_package(Boost)
+set(BOOST_COMPONENTS program_options regex)
+
+if (NOT Boost_VERSION_MAJOR OR
+        (Boost_VERSION_MAJOR EQUAL 1 AND Boost_VERSION_MINOR LESS 69)
+        )
+    # Boost System does not require linking since 1.69
+    set(BOOST_COMPONENTS ${BOOST_COMPONENTS} system)
+endif()
+
 if (MSVC)
-  find_package(Boost REQUIRED COMPONENTS program_options regex system date_time)
-else()
-  find_package(Boost REQUIRED COMPONENTS program_options regex system)
+  set(BOOST_COMPONENTS ${BOOST_COMPONENTS} date_time)
 endif()
 
+find_package(Boost REQUIRED COMPONENTS ${BOOST_COMPONENTS})
+
 if (BUILD_PYTHON_WRAPPER)
     find_package(PythonLibs REQUIRED)
     MESSAGE(STATUS "PYTHON: " ${PYTHONLIBS_VERSION_STRING})