Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Grpc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tci-gateway-module
Grpc
Commits
e2f3465d
Commit
e2f3465d
authored
9 years ago
by
Michael Lumish
Browse files
Options
Downloads
Patches
Plain Diff
Make Node library build on Windows
parent
6b6982bd
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitignore
+4
-0
4 additions, 0 deletions
.gitignore
binding.gyp
+32
-15
32 additions, 15 deletions
binding.gyp
src/node/ext/node_grpc.cc
+2
-2
2 additions, 2 deletions
src/node/ext/node_grpc.cc
with
38 additions
and
17 deletions
.gitignore
+
4
−
0
View file @
e2f3465d
...
...
@@ -12,6 +12,10 @@ htmlcov/
dist/
*.egg
# Node installation output
node_modules/
src/node/extension_binary/
# gcov coverage data
reports
coverage
...
...
This diff is collapsed.
Click to expand it.
binding.gyp
+
32
−
15
View file @
e2f3465d
...
...
@@ -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': '<!(echo $CONFIG)'
},
# TODO: Finish windows support
'target_defaults': {
# Empirically, Node only exports ALPN symbols if its major version is >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=<!(node --version | cut -d. -f1 | cut -c2-)'
],
'include_dirs': [
'.',
'include'
],
'conditions': [
['OS == "win"', {
"include_dirs": [ "third_party/boringssl/include" ]
}, {
"include_dirs": [ "third_party/boringssl/include" ],
"defines": [
'_WIN32_WINNT=0x0600',
'WIN32_LEAN_AND_MEAN',
'_HAS_EXCEPTIONS=0',
'UNICODE',
'_UNICODE',
'NOMINMAX',
'OPENSSL_NO_ASM'
],
"msvs_settings": {
'VCCLCompilerTool': {
'RuntimeLibrary': 1, # static debug
}
},
"libraries": [
"ws2_32"
]
}, { # OS != "win"
# Empirically, Node only exports ALPN symbols if its major version is >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=<!(node --version | cut -d. -f1 | cut -c2-)'
],
'variables': {
'config': '<!(echo $CONFIG)'
},
'include_dirs': [
'<(node_root_dir)/deps/openssl/openssl/include',
'<(node_root_dir)/deps/zlib'
...
...
This diff is collapsed.
Click to expand it.
src/node/ext/node_grpc.cc
+
2
−
2
View file @
e2f3465d
...
...
@@ -112,8 +112,8 @@ void InitCallErrorConstants(Local<Object> exports) {
Nan
::
Set
(
exports
,
Nan
::
New
(
"callError"
).
ToLocalChecked
(),
call_error
);
Local
<
Value
>
OK
(
Nan
::
New
<
Uint32
,
uint32_t
>
(
GRPC_CALL_OK
));
Nan
::
Set
(
call_error
,
Nan
::
New
(
"OK"
).
ToLocalChecked
(),
OK
);
Local
<
Value
>
ERROR
(
Nan
::
New
<
Uint32
,
uint32_t
>
(
GRPC_CALL_ERROR
));
Nan
::
Set
(
call_error
,
Nan
::
New
(
"ERROR"
).
ToLocalChecked
(),
ERROR
);
Local
<
Value
>
CALL_
ERROR
(
Nan
::
New
<
Uint32
,
uint32_t
>
(
GRPC_CALL_ERROR
));
Nan
::
Set
(
call_error
,
Nan
::
New
(
"ERROR"
).
ToLocalChecked
(),
CALL_
ERROR
);
Local
<
Value
>
NOT_ON_SERVER
(
Nan
::
New
<
Uint32
,
uint32_t
>
(
GRPC_CALL_ERROR_NOT_ON_SERVER
));
Nan
::
Set
(
call_error
,
Nan
::
New
(
"NOT_ON_SERVER"
).
ToLocalChecked
(),
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment