From a89d9e764ca915fcb1bba4b730be6f0a7044a6bb Mon Sep 17 00:00:00 2001
From: murgatroid99 <mlumish@google.com>
Date: Tue, 13 Oct 2015 16:03:16 -0700
Subject: [PATCH] Made build flags consistent in Node gcov build

---
 binding.gyp                    | 34 ++++++++++++++++++----------------
 templates/binding.gyp.template | 34 ++++++++++++++++++----------------
 2 files changed, 36 insertions(+), 32 deletions(-)

diff --git a/binding.gyp b/binding.gyp
index 392835c772..6dcb2d012c 100644
--- a/binding.gyp
+++ b/binding.gyp
@@ -54,6 +54,24 @@
     'include_dirs': [
       '.',
       'include'
+    ],
+    'conditions': [
+      ['OS != "win"', {
+        'conditions': [
+          ['config=="gcov"', {
+            'cflags': [
+              '-ftest-coverage',
+              '-fprofile-arcs',
+              '-O0'
+            ],
+            'ldflags': [
+              '-ftest-coverage',
+              '-fprofile-arcs'
+            ]
+          }
+         ]
+        ]
+      }],
     ]
   },
   'targets': [
@@ -278,22 +296,6 @@
         '-g'
       ],
       "conditions": [
-        ['OS != "win"', {
-          'conditions': [
-            ['config=="gcov"', {
-              'cflags': [
-                '-ftest-coverage',
-                '-fprofile-arcs',
-                '-O0'
-              ],
-              'ldflags': [
-                '-ftest-coverage',
-                '-fprofile-arcs'
-              ]
-            }
-           ]
-          ]
-        }],
         ['OS == "mac"', {
           'xcode_settings': {
             'MACOSX_DEPLOYMENT_TARGET': '10.9',
diff --git a/templates/binding.gyp.template b/templates/binding.gyp.template
index 50d0823d1d..bfa6a56bf6 100644
--- a/templates/binding.gyp.template
+++ b/templates/binding.gyp.template
@@ -56,6 +56,24 @@
       'include_dirs': [
         '.',
         'include'
+      ],
+      'conditions': [
+        ['OS != "win"', {
+          'conditions': [
+            ['config=="gcov"', {
+              'cflags': [
+                '-ftest-coverage',
+                '-fprofile-arcs',
+                '-O0'
+              ],
+              'ldflags': [
+                '-ftest-coverage',
+                '-fprofile-arcs'
+              ]
+            }
+           ]
+          ]
+        }],
       ]
     },
     'targets': [
@@ -95,22 +113,6 @@
           '-g'
         ],
         "conditions": [
-          ['OS != "win"', {
-            'conditions': [
-              ['config=="gcov"', {
-                'cflags': [
-                  '-ftest-coverage',
-                  '-fprofile-arcs',
-                  '-O0'
-                ],
-                'ldflags': [
-                  '-ftest-coverage',
-                  '-fprofile-arcs'
-                ]
-              }
-             ]
-            ]
-          }],
           ['OS == "mac"', {
             'xcode_settings': {
               'MACOSX_DEPLOYMENT_TARGET': '10.9',
-- 
GitLab