Added SENF_NO_DEBUG symbol and removed dependency on NDEBUG
[senf.git] / senfscons / SENFSCons.py
index b6e1c0e..b6703ed 100644 (file)
@@ -218,11 +218,12 @@ def MakeEnvironment():
     global opts, finalizers
     InitOpts()
     env = SCons.Environment.Environment(options=opts)
-    for opt in opts.options:
-        if SCons.Script.SConscript.Arguments.get(opt.key):
-            env[opt.key] = SCons.Script.SConscript.Arguments.get(opt.key)
-    if SCons.Script.SConscript.Arguments.get('final'):
-        env['final'] = 1
+    env.Replace(**SCons.Script.SConscript.Arguments)
+    #for opt in opts.options:
+    #    if SCons.Script.SConscript.Arguments.get(opt.key):
+    #        env[opt.key] = SCons.Script.SConscript.Arguments.get(opt.key)
+    #if SCons.Script.SConscript.Arguments.get('final'):
+    #    env['final'] = 1
     env.Help("\nSupported build variables (either in SConfig or on the command line:\n")
     env.Help(opts.GenerateHelpText(env))
 
@@ -246,7 +247,7 @@ def MakeEnvironment():
 
     if env['final']:
         env.Append(CXXFLAGS = [ '-O3' ],
-                   CPPDEFINES = [ 'NDEBUG' ])
+                   CPPDEFINES = [ 'SENF_NO_DEBUG' ])
     else:
         env.Append(CXXFLAGS = [ '-O0', '-g', '-fno-inline' ],
     # The boost-regex library is not compiled with _GLIBCXX_DEBUG so this fails.