mirror of
https://github.com/grpc/grpc-node.git
synced 2025-12-08 18:23:54 +00:00
Merge pull request #2310 from murgatroid99/node_pkg_config
Use pkg-config when building the Node extension, if possible
This commit is contained in:
commit
5700606caa
55
binding.gyp
55
binding.gyp
@ -16,14 +16,48 @@
|
||||
'ldflags': [
|
||||
'-g'
|
||||
],
|
||||
'link_settings': {
|
||||
'libraries': [
|
||||
'-lpthread',
|
||||
'-lgrpc',
|
||||
'-lgpr'
|
||||
]
|
||||
},
|
||||
"conditions": [
|
||||
['OS != "win"', {
|
||||
'variables': {
|
||||
'pkg_config_grpc': '<!(pkg-config --exists grpc >/dev/null 2>&1 && echo true || echo false)'
|
||||
},
|
||||
'conditions': [
|
||||
['pkg_config_grpc == "true"', {
|
||||
'link_settings': {
|
||||
'libraries': [
|
||||
'<!@(pkg-config --libs-only-l --static grpc)'
|
||||
]
|
||||
},
|
||||
'cflags': [
|
||||
'<!@(pkg-config --cflags grpc)'
|
||||
],
|
||||
'libraries': [
|
||||
'<!@(pkg-config --libs-only-L --static grpc)'
|
||||
],
|
||||
'ldflags': [
|
||||
'<!@(pkg-config --libs-only-other --static grpc)'
|
||||
]
|
||||
}, {
|
||||
'link_settings': {
|
||||
'libraries': [
|
||||
'-lpthread',
|
||||
'-lgrpc',
|
||||
'-lgpr'
|
||||
],
|
||||
},
|
||||
'conditions':[
|
||||
['OS != "mac"', {
|
||||
'link_settings': {
|
||||
'libraries': [
|
||||
'-lrt'
|
||||
]
|
||||
}
|
||||
}]
|
||||
]
|
||||
}
|
||||
]
|
||||
]
|
||||
}],
|
||||
['OS == "mac"', {
|
||||
'xcode_settings': {
|
||||
'MACOSX_DEPLOYMENT_TARGET': '10.9',
|
||||
@ -32,13 +66,6 @@
|
||||
'-stdlib=libc++'
|
||||
]
|
||||
}
|
||||
}],
|
||||
['OS != "mac"', {
|
||||
'link_settings': {
|
||||
'libraries': [
|
||||
'-lrt'
|
||||
]
|
||||
}
|
||||
}]
|
||||
],
|
||||
"target_name": "grpc",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user