From fecaed7da851417bbed62cadcb2cc736f25678c7 Mon Sep 17 00:00:00 2001
From: Andrea Shepard <andrea@special-circumstanc.es>
Date: Fri, 10 Jan 2020 20:28:58 +0000
Subject: [PATCH] Cleaner SConstruct for profiling

---
 SConstruct | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/SConstruct b/SConstruct
index 6094d081..2dd7f569 100644
--- a/SConstruct
+++ b/SConstruct
@@ -127,9 +127,9 @@ else:
     env.MergeFlags('-lrt')
 
 if GetOption('coverage'):
-    env.Append(CFLAGS=['--coverage'],
-               CXXFLAGS=['--coverage'],
-               LDFLAGS=['--coverage'])
+    env.Append(CCFLAGS=['--coverage'],
+               LDFLAGS=['--coverage'],
+               LINKFLAGS=['--coverage'])
     if env['CC'] == 'gcc':
         env.Append(LIBS=['gcov'])
     else:
@@ -137,10 +137,9 @@ if GetOption('coverage'):
 
 if GetOption('gprof'):
     if env['CC'] == 'gcc' and env['CXX'] == 'g++':
-        env.Append(CFLAGS=['-pg', '-fprofile-arcs'],
-                   CXXFLAGS=['-pg', '-fprofile-arcs'],
-		   LDFLAGS=['-pg', '-fprofile-arcs'],
-                   LINKFLAGS=['-pg', '-fprofile-arcs'])
+        env.Append(CCFLAGS=['-pg'],
+		   LDFLAGS=['-pg'],
+                   LINKFLAGS=['-pg'])
         env.Append(LIBS=['gcov'])
         env['GPROF'] = 1
     else:
-- 
GitLab