Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows support #248

Merged
merged 1 commit into from
Oct 18, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
134 changes: 69 additions & 65 deletions binding.gyp
Original file line number Diff line number Diff line change
@@ -1,94 +1,98 @@
{
"variables": {
# may be redefined in command line on configuration stage
"BUILD_LIBRDKAFKA%": "<!(echo ${BUILD_LIBRDKAFKA:-1})",
"WITH_SASL%": "<!(echo ${WITH_SASL:-1})",
"WITH_LZ4%": "<!(echo ${WITH_LZ4:-0})"
# "build_librdkafka%": "<!(echo ${BUILD_LIBRDKAFKA:-1})"
"build_librdkafka%": "1"
},
"targets": [
{
"target_name": "node-librdkafka",
"sources": [ "<!@(ls -1 src/*.cc)", ],
'sources': [
'src/binding.cc',
'src/callbacks.cc',
'src/common.cc',
'src/config.cc',
'src/connection.cc',
'src/errors.cc',
'src/kafka-consumer.cc',
'src/producer.cc',
'src/topic.cc',
'src/workers.cc'
],
"include_dirs": [
"<!(node -e \"require('nan')\")",
"<(module_root_dir)/"
],
'conditions': [
[ "<(BUILD_LIBRDKAFKA)==1",
{
"dependencies": [
"<(module_root_dir)/deps/librdkafka.gyp:librdkafka_cpp"
],
"include_dirs": [ "deps/librdkafka/src-cpp" ],
},
# Else link against globally installed rdkafka and use
# globally installed headers. On Debian, you should
# install the librdkafka1, librdkafka++1, and librdkafka-dev
# .deb packages.
{
"libraries": ["-lrdkafka", "-lrdkafka++"],
"include_dirs": [
"/usr/include/librdkafka",
"/usr/local/include/librdkafka"
],
},
],
[
'OS=="linux"',
{
'cflags_cc' : [
'-std=c++11'
],
'cflags_cc!': [
'-fno-rtti'
]
}
],
[
'OS=="win"',
{
'cflags_cc' : [
'-std=c++11'
]
}
],
[
'OS=="mac"',
{
'xcode_settings': {
'MACOSX_DEPLOYMENT_TARGET': '10.11',
'GCC_ENABLE_CPP_RTTI': 'YES',
'OTHER_CPLUSPLUSFLAGS': [
'-std=c++11'
],
],
'msvs_settings': {
'VCCLCompilerTool': {
'AdditionalOptions': [
'/GR'
],
'AdditionalUsingDirectories': [
'<(module_root_dir)/deps/librdkafka/win32/outdir/v120/x64/Release/'
]
}
},
}
],
[ "<(WITH_SASL)==1",
'msvs_version': '2013',
'msbuild_toolset': 'v120',
"dependencies": [
"<(module_root_dir)/deps/librdkafka.gyp:librdkafkacpp"
],
'include_dirs': [
'deps/librdkafka/src-cpp'
]
},
{
'libraries' : ['-lsasl2'],
'conditions': [
[ 'OS=="mac"',
[ "<(build_librdkafka)==1",
{
'xcode_settings': {
'libraries' : ['-lsasl2']
}
"dependencies": [
"<(module_root_dir)/deps/librdkafka.gyp:librdkafkacpp"
],
"include_dirs": [ "deps/librdkafka/src-cpp" ],
},
# Else link against globally installed rdkafka and use
# globally installed headers. On Debian, you should
# install the librdkafka1, librdkafka++1, and librdkafka-dev
# .deb packages.
{
"libraries": ["-lrdkafka", "-lrdkafka++"],
"include_dirs": [
"/usr/include/librdkafka",
"/usr/local/include/librdkafka"
],
},
],
[
'OS=="linux"',
{
'cflags_cc' : [
'-std=c++11'
],
'cflags_cc!': [
'-fno-rtti'
]
}
],
]
}
],
[ "<(WITH_LZ4)==1",
{
'libraries' : ['-llz4'],
'conditions': [
[ 'OS=="mac"',
[
'OS=="mac"',
{
'xcode_settings': {
'libraries' : ['-llz4']
}
'MACOSX_DEPLOYMENT_TARGET': '10.11',
'GCC_ENABLE_CPP_RTTI': 'YES',
'OTHER_CPLUSPLUSFLAGS': [
'-std=c++11'
],
},
}
],
]
]
}
]
Expand Down
Loading