From 34de90194bba5561663f3889809d0adea1e51e65 Mon Sep 17 00:00:00 2001
From: Evan Lucas <evanlucas@me.com>
Date: Mon, 24 Aug 2015 19:13:22 -0500
Subject: [PATCH] build: only define NODE_V8_OPTIONS if not empty

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 | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/node.gyp b/node.gyp
index 7b2d0a54f7cfd3..af5a4bb7501911 100644
--- a/node.gyp
+++ b/node.gyp
@@ -179,7 +179,6 @@
       'defines': [
         'NODE_ARCH="<(target_arch)"',
         'NODE_PLATFORM="<(OS)"',
-        'NODE_V8_OPTIONS="<(node_v8_options)"',
         'NODE_WANT_INTERNALS=1',
       ],
 
@@ -188,6 +187,9 @@
         [ '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!': [