-
Notifications
You must be signed in to change notification settings - Fork 396
/
binding.gyp
154 lines (154 loc) · 4.6 KB
/
binding.gyp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
{
"variables": {
# may be redefined in command line on configuration stage
# "BUILD_LIBRDKAFKA%": "<!(echo ${BUILD_LIBRDKAFKA:-1})"
"BUILD_LIBRDKAFKA%": "<!(node ./util/get-env.js BUILD_LIBRDKAFKA 1)",
},
"targets": [
{
"target_name": "node-librdkafka",
'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',
'src/admin.cc'
],
"include_dirs": [
"<!(node -e \"require('nan')\")",
"<(module_root_dir)/"
],
'conditions': [
[
'OS=="win"',
{
'actions': [
{
'action_name': 'nuget_librdkafka_download',
'inputs': [
'deps/windows-install.py'
],
'outputs': [
'deps/precompiled/librdkafka.lib',
'deps/precompiled/librdkafkacpp.lib'
],
'message': 'Getting librdkafka from nuget',
'action': ['python', '<@(_inputs)']
}
],
'cflags_cc' : [
'-std=c++17'
],
'msvs_settings': {
'VCLinkerTool': {
'AdditionalDependencies': [
'librdkafka.lib',
'librdkafkacpp.lib'
],
'AdditionalLibraryDirectories': [
'../deps/precompiled/'
]
},
'VCCLCompilerTool': {
'AdditionalOptions': [
'/GR'
],
'AdditionalUsingDirectories': [
'deps/precompiled/'
],
'AdditionalIncludeDirectories': [
'deps/librdkafka/src',
'deps/librdkafka/src-cpp'
]
}
},
'include_dirs': [
'deps/include'
]
},
{
'conditions': [
[ "<(BUILD_LIBRDKAFKA)==1",
{
"dependencies": [
"deps/librdkafka.gyp:librdkafka"
],
"include_dirs": [
"deps/librdkafka/src",
"deps/librdkafka/src-cpp"
],
'conditions': [
[
'OS=="linux"',
{
"libraries": [
"../build/deps/librdkafka.so",
"../build/deps/librdkafka++.so",
"-Wl,-rpath='$$ORIGIN/../deps'",
],
}
],
[
'OS=="mac"',
{
"libraries": [
"../build/deps/librdkafka.dylib",
"../build/deps/librdkafka++.dylib",
],
}
]
],
},
# 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",
"/opt/include/librdkafka",
],
},
],
[
'OS=="linux"',
{
'cflags_cc' : [
'-std=c++17'
],
'cflags_cc!': [
'-fno-rtti'
]
}
],
[
'OS=="mac"',
{
'xcode_settings': {
'MACOSX_DEPLOYMENT_TARGET': '10.11',
'GCC_ENABLE_CPP_RTTI': 'YES',
'OTHER_LDFLAGS': [
'-L/usr/local/opt/openssl/lib'
],
'OTHER_CPLUSPLUSFLAGS': [
'-I/usr/local/opt/openssl/include',
'-std=c++17'
],
},
}
]
]
}
]
]
}
]
}