Closed jeeftor closed 4 years ago
The more I dig into things it really seems windows is pretty borked...
Additionally it doesn't appear that the definitions: add_definitions("-DNOMINMAX=1")
for windows ever get set because there is always a CXX flags...
I dont know if I have time to dig into this further - but if anybody has successfully built a 32 and a 64 version of windows please reply to this thread
This is how I got windows build (64bit) working with Visual Studio 2017
Use vcpkg
to install required libs:
# Install vcpkg if not already installed
git clone https://github.com/Microsoft/vcpkg.git
cd vcpkg
bootstrap-vcpkg.bat
vcpkg integrate install
# Install librdkafka
vcpkg install librdkafka pthread --triplet x64-windows
and then this:
git config --global http.sslVerify false
git clone https://github.com/mfontanini/cppkafka.git
cd cppkafka
# Download nuget and checkout boost
curl -sq -k -o nuget.exe https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
nuget install boost -Version 1.72.0 -OutputDirectory packages
# build in the b64 directory (but clean it out before running)
del /s /q c:/cppkafka/b64 & cmake -S c:/cppkafka -B c:/cppkafka/b64 ^
-DBoost_DEBUG=OFF -DCMAKE_GENERATOR_PLATFORM=x64 ^
-DBOOST_ROOT=c:/cppkafka/packages/boost.1.72.0.0 ^
-DCPPKAFKA_RDKAFKA_STATIC_LIB=1 ^
-DBoost_INCLUDE_DIR=c:/cppkafka/packages/boost.1.72.0.0/lib/native/include ^
-DCPPKAFKA_CMAKE_VERBOSE=OFF ^
-DCMAKE_FIND_DEBUG_MODE=false ^
-DRDKAFKA_ROOT=c:/cppkafka/librdkafka/ ^
-DCPPKAFKA_DISABLE_EXAMPLES=ON ^
-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake ^
-DCPPKAFKA_DISABLE_EXAMPLES=ON ^
-DCPPKAFKA_RDKAFKA_STATIC_LIB=ON ^
-G "Visual Studio 15 2017" & cmake --build c:/cppkafka/b64 --config Release & cmake --install c:/cppkafka/b64 --config Release
The directions for windows building says to use
nuget
to install librdkafka.This is what the expanded package list looks like:
On windows I'm finding that passing in
-DRDKAFKA_ROOT=C:\cppkafka\packages\librdkafka.redist.1.5.0
in insufficient to actually find the correct libs.