You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by aa...@apache.org on 2019/10/05 03:25:08 UTC

[pulsar] branch master updated: Fix Cmake files for windows compilation (#5303)

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

aahmed 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 3fa5832  Fix Cmake files for windows compilation (#5303)
3fa5832 is described below

commit 3fa58320650809f39df741755e06702674e3f731
Author: Ali Ahmed <al...@gmail.com>
AuthorDate: Fri Oct 4 20:25:00 2019 -0700

    Fix Cmake files for windows compilation (#5303)
    
    * Fix Cmake files for windows compilation
    
    Add import <string> to schema.h for msvc
    
    * Refactor if condition
---
 pulsar-client-cpp/CMakeLists.txt          | 13 ++++++++++++-
 pulsar-client-cpp/include/pulsar/Schema.h |  1 +
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/pulsar-client-cpp/CMakeLists.txt b/pulsar-client-cpp/CMakeLists.txt
index 6ee1f77..7ab7909 100644
--- a/pulsar-client-cpp/CMakeLists.txt
+++ b/pulsar-client-cpp/CMakeLists.txt
@@ -102,7 +102,11 @@ else()
     endif (USE_LOG4CXX)
 endif (LINK_STATIC)
 
-find_package(Boost REQUIRED COMPONENTS program_options regex system)
+if (MSVC)
+  find_package(Boost REQUIRED COMPONENTS program_options regex system date_time)
+else()
+  find_package(Boost REQUIRED COMPONENTS program_options regex system)
+endif()
 
 find_package(ZLIB REQUIRED)
 
@@ -223,6 +227,13 @@ set(COMMON_LIBS
   ${ADDITIONAL_LIBRARIES}
 )
 
+if (MSVC)
+  set(COMMON_LIBS
+    ${COMMON_LIBS}
+    ${Boost_DATE_TIME_LIBRARY}
+  )
+endif()
+
 if (NOT MSVC)
     set(COMMON_LIBS
     ${COMMON_LIBS} -lpthread -lm
diff --git a/pulsar-client-cpp/include/pulsar/Schema.h b/pulsar-client-cpp/include/pulsar/Schema.h
index e889fb1..b14851e 100644
--- a/pulsar-client-cpp/include/pulsar/Schema.h
+++ b/pulsar-client-cpp/include/pulsar/Schema.h
@@ -22,6 +22,7 @@
 
 #include <iosfwd>
 #include <memory>
+#include <string>
 #include <pulsar/defines.h>
 
 namespace pulsar {