diff options
author | murgatroid99 <michael.lumish@gmail.com> | 2015-01-23 10:53:51 -0800 |
---|---|---|
committer | murgatroid99 <michael.lumish@gmail.com> | 2015-01-23 10:53:51 -0800 |
commit | 51fca2da4b6974d3f56d894f1caa98fd8d32f120 (patch) | |
tree | 9cd90e1600d53c03a95251595d2f034e8af829c5 /src | |
parent | d10c0abaf646f7635c1c0cb292c44036c6b64c05 (diff) |
Made node library buildable from source tree
Diffstat (limited to 'src')
-rw-r--r-- | src/node/binding.gyp | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/src/node/binding.gyp b/src/node/binding.gyp index da4a943491..fe4b5da9c8 100644 --- a/src/node/binding.gyp +++ b/src/node/binding.gyp @@ -1,8 +1,13 @@ { + "variables" : { + 'no_install': "<!(echo $GRPC_NO_INSTALL)", + 'grpc_root': "<!(echo $GRPC_ROOT)", + 'grpc_lib_subdir': "<!(echo $GRPC_LIB_SUBDIR)" + }, "targets" : [ { 'include_dirs': [ - "<!(node -e \"require('nan')\")" + "<!(nodejs -e \"require('nan')\")" ], 'cxxflags': [ '-Wall', @@ -11,16 +16,13 @@ '-g', '-zdefs' '-Werror', - ], + ], 'ldflags': [ - '-g', - '-L/usr/local/google/home/mlumish/grpc_dev/lib' + '-g' ], 'link_settings': { 'libraries': [ - '-lgrpc', '-lrt', - '-lgpr', '-lpthread' ], }, @@ -37,6 +39,27 @@ "server_credentials.cc", "tag.cc", "timeval.cc" + ], + 'conditions' : [ + ['no_install=="yes"', { + 'include_dirs': [ + "<(grpc_root)/include" + ], + 'link_settings': { + 'libraries': [ + '<(grpc_root)/<(grpc_lib_subdir)/libgrpc.a', + '<(grpc_root)/<(grpc_lib_subdir)/libgpr.a' + ] + } + }], + ['no_install!="yes"', { + 'link_settings': { + 'libraries': [ + '-lgrpc', + '-lgpr' + ] + } + }] ] } ] |