Skip to content

Commit 00a4d03

Browse files
committed
Use single condition in gyp and
avoid parallel targets execution
1 parent 99ca4ec commit 00a4d03

File tree

2 files changed

+53
-33
lines changed

2 files changed

+53
-33
lines changed

binding.gyp

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -86,17 +86,28 @@
8686
],
8787
'conditions': [
8888
[
89-
['OS=="linux"', 'CKJS_LINKING="dynamic"'],
89+
'CKJS_LINKING=="dynamic"',
9090
{
91-
"libraries": [
92-
"../build/deps/librdkafka.so",
93-
"../build/deps/librdkafka++.so",
94-
"-Wl,-rpath='$$ORIGIN/../deps'",
95-
],
96-
}
97-
],
98-
[
99-
['OS=="linux"', 'CKJS_LINKING!="dynamic"'],
91+
"conditions": [
92+
[
93+
'OS=="mac"',
94+
{
95+
"libraries": [
96+
"../build/deps/librdkafka.dylib",
97+
"../build/deps/librdkafka++.dylib",
98+
"-Wl,-rpath='$$ORIGIN/../deps'",
99+
],
100+
},
101+
{
102+
"libraries": [
103+
"../build/deps/librdkafka.so",
104+
"../build/deps/librdkafka++.so",
105+
"-Wl,-rpath='$$ORIGIN/../deps'",
106+
],
107+
},
108+
]
109+
]
110+
},
100111
{
101112
"libraries": [
102113
"../build/deps/librdkafka-static.a",
@@ -105,15 +116,6 @@
105116
],
106117
}
107118
],
108-
[
109-
'OS=="mac"',
110-
{
111-
"libraries": [
112-
"../build/deps/librdkafka.dylib",
113-
"../build/deps/librdkafka++.dylib",
114-
],
115-
}
116-
]
117119
],
118120
},
119121
# Else link against globally installed rdkafka and use

deps/librdkafka.gyp

Lines changed: 32 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
2+
"variables": {
3+
"CKJS_LINKING%": "<!(node ../util/get-env.js CKJS_LINKING static)",
4+
},
25
'targets': [
36
{
47
"target_name": "librdkafka",
@@ -26,30 +29,45 @@
2629
"librdkafka/config.h",
2730
],
2831
"action": [
29-
"make", "-j5", "-C", "librdkafka", "libs", "install"
32+
"make", "-C", "librdkafka", "libs", "install"
3033
],
3134
"conditions": [
3235
[
33-
'OS=="mac"',
36+
'CKJS_LINKING=="dynamic"',
3437
{
35-
'outputs': [
36-
'deps/librdkafka/src-cpp/librdkafka++.dylib',
37-
'deps/librdkafka/src-cpp/librdkafka++.1.dylib',
38-
'deps/librdkafka/src/librdkafka.dylib',
39-
'deps/librdkafka/src/librdkafka.1.dylib'
40-
],
38+
"conditions": [
39+
[
40+
'OS=="mac"',
41+
{
42+
'outputs': [
43+
'deps/librdkafka/src-cpp/librdkafka++.dylib',
44+
'deps/librdkafka/src-cpp/librdkafka++.1.dylib',
45+
'deps/librdkafka/src/librdkafka.dylib',
46+
'deps/librdkafka/src/librdkafka.1.dylib',
47+
'deps/librdkafka/src-cpp/librdkafka++.a',
48+
'deps/librdkafka/src/librdkafka.a',
49+
]
50+
},
51+
{
52+
'outputs': [
53+
'deps/librdkafka/src-cpp/librdkafka++.so',
54+
'deps/librdkafka/src-cpp/librdkafka++.so.1',
55+
'deps/librdkafka/src/librdkafka.so',
56+
'deps/librdkafka/src/librdkafka.so.1',
57+
'deps/librdkafka/src-cpp/librdkafka++.a',
58+
'deps/librdkafka/src/librdkafka.a',
59+
],
60+
},
61+
],
62+
]
4163
},
4264
{
4365
'outputs': [
44-
'deps/librdkafka/src-cpp/librdkafka++.so',
45-
'deps/librdkafka/src-cpp/librdkafka++.so.1',
46-
'deps/librdkafka/src/librdkafka.so',
47-
'deps/librdkafka/src/librdkafka.so.1',
4866
'deps/librdkafka/src-cpp/librdkafka++.a',
49-
'deps/librdkafka/src/librdkafka.a',
67+
'deps/librdkafka/src/librdkafka-static.a',
5068
],
5169
}
52-
]
70+
],
5371
],
5472
}
5573
]

0 commit comments

Comments
 (0)