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
fef39136
Commit
fef39136
authored
7 years ago
by
murgatroid99
Browse files
Options
Downloads
Patches
Plain Diff
Node: explicitly define Release and Debug builds, use build flags from build.yaml
parent
6f1e443a
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
binding.gyp
+52
-24
52 additions, 24 deletions
binding.gyp
templates/binding.gyp.template
+40
-24
40 additions, 24 deletions
templates/binding.gyp.template
tools/run_tests/helper_scripts/build_node.sh
+2
-1
2 additions, 1 deletion
tools/run_tests/helper_scripts/build_node.sh
with
94 additions
and
49 deletions
binding.gyp
+
52
−
24
View file @
fef39136
...
...
@@ -47,9 +47,42 @@
# Some Node installations use the system installation of OpenSSL, and on
# some systems, the system OpenSSL still does not have ALPN support. This
# will let users recompile gRPC to work without ALPN.
'grpc_alpn%': 'true'
'grpc_alpn%': 'true',
# Indicates that the library should be built with gcov.
'grpc_gcov%': 'false'
},
'target_defaults': {
'configurations': {
'Release': {
'cflags': [
'-O2',
],
'defines': [
'NDEBUG',
],
},
'Debug': {
'cflags': [
'-O0',
],
'defines': [
'_DEBUG',
'DEBUG',
],
},
},
'cflags': [
'-g',
'-Wall',
'-Wextra',
'-Werror',
'-Wno-long-long',
'-Wno-unused-parameter',
'-DOSATOMIC_USE_INLINED=1',
],
'ldflags': [
'-g',
],
'include_dirs': [
'.',
'include'
...
...
@@ -63,6 +96,24 @@
'GRPC_UV'
]
}],
['grpc_gcov=="true"', {
'cflags': [
'-O0',
'-fprofile-arcs',
'-ftest-coverage',
'-Wno-return-type',
],
'defines': [
'_DEBUG',
'DEBUG',
'GPR_GCOV',
],
'ldflags': [
'-fprofile-arcs',
'-ftest-coverage',
'-rdynamic',
],
}],
['OS!="win" and runtime=="electron"', {
"defines": [
'OPENSSL_NO_THREADS'
...
...
@@ -124,25 +175,8 @@
"ws2_32"
]
}, { # OS != "win"
'variables': {
'config': '<!(echo $CONFIG)',
},
'include_dirs': [
'<(node_root_dir)/deps/zlib'
],
'conditions': [
['config=="gcov"', {
'cflags': [
'-ftest-coverage',
'-fprofile-arcs',
'-O0'
],
'ldflags': [
'-ftest-coverage',
'-fprofile-arcs'
]
}
]
]
}]
]
...
...
@@ -851,16 +885,10 @@
],
'cflags': [
'-std=c++11',
'-Wall',
'-pthread',
'-g',
'-zdefs',
'-Werror',
'-Wno-error=deprecated-declarations'
],
'ldflags': [
'-g'
],
"conditions": [
['OS=="win" or runtime=="electron"', {
'dependencies': [
...
...
This diff is collapsed.
Click to expand it.
templates/binding.gyp.template
+
40
−
24
View file @
fef39136
...
...
@@ -49,9 +49,37 @@
# Some Node installations use the system installation of OpenSSL, and on
# some systems, the system OpenSSL still does not have ALPN support. This
# will let users recompile gRPC to work without ALPN.
'grpc_alpn%': 'true'
'grpc_alpn%': 'true',
# Indicates that the library should be built with gcov.
'grpc_gcov%': 'false'
},
'target_defaults': {
'configurations': {
% for name, args in configs.iteritems():
% if name in ['dbg', 'opt']:
'${{'dbg':'Debug', 'opt': 'Release'}[name]}': {
% for arg, prop in [('CPPFLAGS', 'cflags'), ('DEFINES', 'defines')]:
% if args.get(arg, None) is not None:
'${prop}': [
% for item in args.get(arg).split():
'${item}',
% endfor
],
% endif
% endfor
},
% endif
% endfor
},
% for arg, prop in [('CPPFLAGS', 'cflags'), ('LDFLAGS', 'ldflags')]:
% if defaults['global'].get(arg, None) is not None:
'${prop}': [
% for item in defaults['global'].get(arg).split():
'${item}',
% endfor
],
% endif
% endfor
'include_dirs': [
'.',
'include'
...
...
@@ -65,6 +93,17 @@
'GRPC_UV'
]
}],
['grpc_gcov=="true"', {
% for arg, prop in [('CPPFLAGS', 'cflags'), ('DEFINES', 'defines'), ('LDFLAGS', 'ldflags')]:
% if configs['gcov'].get(arg, None) is not None:
'${prop}': [
% for item in configs['gcov'].get(arg).split():
'${item}',
% endfor
],
% endif
% endfor
}],
['OS!="win" and runtime=="electron"', {
"defines": [
'OPENSSL_NO_THREADS'
...
...
@@ -126,25 +165,8 @@
"ws2_32"
]
}, { # OS != "win"
'variables': {
'config': '<!(echo $CONFIG)',
},
'include_dirs': [
'<(node_root_dir)/deps/zlib'
],
'conditions': [
['config=="gcov"', {
'cflags': [
'-ftest-coverage',
'-fprofile-arcs',
'-O0'
],
'ldflags': [
'-ftest-coverage',
'-fprofile-arcs'
]
}
]
]
}]
]
...
...
@@ -274,16 +296,10 @@
],
'cflags': [
'-std=c++11',
'-Wall',
'-pthread',
'-g',
'-zdefs',
'-Werror',
'-Wno-error=deprecated-declarations'
],
'ldflags': [
'-g'
],
"conditions": [
['OS=="win" or runtime=="electron"', {
'dependencies': [
...
...
This diff is collapsed.
Click to expand it.
tools/run_tests/helper_scripts/build_node.sh
+
2
−
1
View file @
fef39136
...
...
@@ -41,7 +41,8 @@ CONFIG=${CONFIG:-opt}
cd
$(
dirname
$0
)
/../../..
case
"
$CONFIG
"
in
'dbg'
)
config_flag
=
'--debug'
;;
'dbg'
)
config_flags
=
'--debug'
;;
'gcov'
)
config_flags
=
"--debug --grpc_gcov=true"
;;
*
)
config_flag
=
'--release'
;;
esac
...
...
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