build: only define NODE_V8_OPTIONS if not empty
authorEvan Lucas <evanlucas@me.com>
Tue, 25 Aug 2015 00:13:22 +0000 (19:13 -0500)
committerEvan Lucas <evanlucas@me.com>
Tue, 25 Aug 2015 16:42:26 +0000 (11:42 -0500)
Previously, V8::SetFlagsFromString was called on every launch even if
NODE_V8_OPTIONS was an empty string. This patch only defines
NODE_V8_OPTIONS if node_v8_options is not an empty string.

PR-URL: https://github.com/nodejs/node/pull/2532
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Rod Vagg <rod@vagg.org>
node.gyp

index d86cd1c..7716287 100644 (file)
--- a/node.gyp
+++ b/node.gyp
       'defines': [
         'NODE_ARCH="<(target_arch)"',
         'NODE_PLATFORM="<(OS)"',
-        'NODE_V8_OPTIONS="<(node_v8_options)"',
         'NODE_WANT_INTERNALS=1',
       ],
 
         [ 'node_tag!=""', {
           'defines': [ 'NODE_TAG="<(node_tag)"' ],
         }],
+        [ 'node_v8_options!=""', {
+          'defines': [ 'NODE_V8_OPTIONS="<(node_v8_options)"'],
+        }],
         # No node_main.cc for anything except executable
         [ 'node_target_type!="executable"', {
           'sources!': [