From e2f3465dd4e7dbb2c6aeb00ea867668b1783c883 Mon Sep 17 00:00:00 2001 From: Michael Lumish Date: Wed, 27 Jan 2016 16:41:54 -0800 Subject: Make Node library build on Windows --- .gitignore | 4 ++++ binding.gyp | 47 ++++++++++++++++++++++++++++++++--------------- src/node/ext/node_grpc.cc | 4 ++-- 3 files changed, 38 insertions(+), 17 deletions(-) diff --git a/.gitignore b/.gitignore index cc70659661..7652908e5c 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,10 @@ htmlcov/ dist/ *.egg +# Node installation output +node_modules/ +src/node/extension_binary/ + # gcov coverage data reports coverage diff --git a/binding.gyp b/binding.gyp index b1c0214d5f..d0932da957 100644 --- a/binding.gyp +++ b/binding.gyp @@ -37,29 +37,46 @@ # Some of this file is built with the help of # https://n8.io/converting-a-c-library-to-gyp/ { - 'variables': { - 'config': '0. - # io.js always reports versions >0 and always exports ALPN symbols. - # Therefore, Node's major version will be truthy if and only if it - # supports ALPN. The output of "node -v" is v[major].[minor].[patch], - # like "v4.1.1" in a recent version. We use cut to split by period and - # take the first field (resulting in "v[major]"), then use cut again - # to take all but the first character, removing the "v". - 'defines': [ - 'TSI_OPENSSL_ALPN_SUPPORT=0. + # io.js always reports versions >0 and always exports ALPN symbols. + # Therefore, Node's major version will be truthy if and only if it + # supports ALPN. The output of "node -v" is v[major].[minor].[patch], + # like "v4.1.1" in a recent version. We use cut to split by period and + # take the first field (resulting in "v[major]"), then use cut again + # to take all but the first character, removing the "v". + 'defines': [ + 'TSI_OPENSSL_ALPN_SUPPORT= exports) { Nan::Set(exports, Nan::New("callError").ToLocalChecked(), call_error); Local OK(Nan::New(GRPC_CALL_OK)); Nan::Set(call_error, Nan::New("OK").ToLocalChecked(), OK); - Local ERROR(Nan::New(GRPC_CALL_ERROR)); - Nan::Set(call_error, Nan::New("ERROR").ToLocalChecked(), ERROR); + Local CALL_ERROR(Nan::New(GRPC_CALL_ERROR)); + Nan::Set(call_error, Nan::New("ERROR").ToLocalChecked(), CALL_ERROR); Local NOT_ON_SERVER( Nan::New(GRPC_CALL_ERROR_NOT_ON_SERVER)); Nan::Set(call_error, Nan::New("NOT_ON_SERVER").ToLocalChecked(), -- cgit v1.2.3