ocarina/config
Bryan Schumaker 7c67d062df build: Make it easier to change command line macros
I store release and debug options in a list so that env.Replace() can be
used to set, modify, and restore values.

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
2014-04-06 19:56:51 -04:00

34 lines
749 B
Python

#!/usr/bin/python
import os
CONFIG_VERSION = 6.0
CONFIG_DEBUG = True
Export("CONFIG_VERSION", "CONFIG_DEBUG")
# Set up default environments
def get_env(flags):
e = Environment(CCFLAGS = flags)
e.Append(CPPPATH = os.path.abspath("include"))
e.Append(CXXCOMSTR = "C++ $TARGET")
e.Append(LINKCOMSTR = "Linking $TARGET")
return e
CONFIG_RELEASE = [ "-O2" ]
CONFIG_DEBUG = [ "-Wall", "-Werror", "-g", "-DCONFIG_DEBUG" ]
release = get_env(CONFIG_RELEASE)
debug = get_env(CONFIG_DEBUG)
env = release
if CONFIG_DEBUG == True:
env = debug
Export("release", "debug", "env", "CONFIG_RELEASE", "CONFIG_DEBUG")
# Import SConscript files
include = SConscript("include/Sconscript")
tests = SConscript("tests/Sconscript")
Alias("tests", tests)