Made node library buildable from source tree

pull/178/head
murgatroid99 10 years ago
parent d10c0abaf6
commit 51fca2da4b
  1. 35
      src/node/binding.gyp
  2. 20
      tools/run_tests/build_node.sh

@ -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'
]
}
}]
]
}
]

@ -0,0 +1,20 @@
#!/bin/bash
set -ex
# change to grpc repo root
cd $(dirname $0)/../..
# tells npm install to look for files in that directory
export GRPC_ROOT=`pwd`
# tells npm install the subdirectory with library files
export GRPC_LIB_SUBDIR=libs/opt
# tells npm install not to use default locations
export GRPC_NO_INSTALL=yes
# build the c libraries
make -j static_c
cd src/node
npm install
Loading…
Cancel
Save