Skip to content

Commit

Permalink
Fix Cmake files for windows compilation (apache#5303)
Browse files Browse the repository at this point in the history
* Fix Cmake files for windows compilation

Add import <string> to schema.h for msvc

* Refactor if condition
  • Loading branch information
aahmed-se authored Oct 5, 2019
1 parent c9d5a9f commit 3fa5832
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
13 changes: 12 additions & 1 deletion pulsar-client-cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions pulsar-client-cpp/include/pulsar/Schema.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

#include <iosfwd>
#include <memory>
#include <string>
#include <pulsar/defines.h>

namespace pulsar {
Expand Down

0 comments on commit 3fa5832

Please sign in to comment.