Browse Source

better debugging experience on linux

karroffel 7 years ago
parent
commit
94ec311924
1 changed files with 6 additions and 1 deletions
  1. 6 1
      SConstruct

+ 6 - 1
SConstruct

@@ -27,9 +27,14 @@ if target_platform == 'linux':
     if ARGUMENTS.get('use_llvm', 'no') == 'yes':
         env['CXX'] = 'clang++'
 
-    env.Append(CCFLAGS = [ '-fPIC', '-g', '-O3', '-std=c++14', '-Wwrite-strings' ])
+    env.Append(CCFLAGS = [ '-fPIC', '-g', '-std=c++14', '-Wwrite-strings' ])
     env.Append(LINKFLAGS = [ '-Wl,-R,\'$$ORIGIN\'' ])
 
+    if target == 'debug':
+        env.Append(CCFLAGS = ['-Og'])
+    else:
+        env.Append(CCFLAGS = ['-O3'])
+
     if target_arch == '32':
         env.Append(CCFLAGS = [ '-m32' ])
         env.Append(LINKFLAGS = [ '-m32' ])