summaryrefslogtreecommitdiff
path: root/SConscript
diff options
context:
space:
mode:
authorjacksonmj <mj-pt@jacksonmj.co.uk>2013-10-19 13:03:37 (GMT)
committer jacksonmj <mj-pt@jacksonmj.co.uk>2013-10-19 13:03:37 (GMT)
commiteea006ad6f63083782a3decda51b6bf80caa47af (patch)
tree67f62aeb2132fc0a379dd16844bfc054776dc906 /SConscript
parent6edb96ee51df8dbe8b0d1e4778bb7e92b6284d12 (diff)
downloadpowder-eea006ad6f63083782a3decda51b6bf80caa47af.zip
powder-eea006ad6f63083782a3decda51b6bf80caa47af.tar.gz
SConscript changes from Doxin - option for scons to copy environment variables CC, CXX, LD, CFLAGS
Diffstat (limited to 'SConscript')
-rwxr-xr-xSConscript13
1 files changed, 11 insertions, 2 deletions
diff --git a/SConscript b/SConscript
index f1924a3..38a6b25 100755
--- a/SConscript
+++ b/SConscript
@@ -89,6 +89,7 @@ AddOption('--stable',dest="stable",default=True,help="Non snapshot build")
AddOption('--aao', dest="everythingAtOnce", action='store_true', default=False, help="Compile the whole game without generating intermediate objects (very slow), enable this when using compilers like clang or mscc that don't support -fkeep-inline-functions")
AddOption('--fullclean',dest="justwork",action='store_true',default=False,help="for when nothing else works. Deletes all sconscript temporary files.")
+AddOption('--copy-env',dest="copy_env",action='store_true',default=False,help="copy some common enviroment variables from the parent enviroment.")
# using one of these commandline options is compulsory
@@ -134,9 +135,17 @@ if((not GetOption('lin')) and (not GetOption('win')) and (not GetOption('rpi'))
# if the platform is windows switch to a mingw toolset, use the default otherwise
if(GetOption('win')):
- env = Environment(tools = ['mingw'], ENV = os.environ)
+ env = Environment(tools = ['mingw'])
else:
- env = Environment(tools = ['default'], ENV = os.environ)
+ env = Environment(tools = ['default'])
+
+if(GetOption("copy_env")):
+ lstvar=["CC","CXX","LD","CFLAGS"]
+ print "WARNING: enviroment copying enabled. changes in the enviroment can easily break the build process."
+ for var in lstvar:
+ if var in os.environ:
+ env[var]=os.environ[var]
+ print "WARNING: copying enviroment variable {}={!r}".format(var,os.environ[var])
# macosx specific platform settings
# +++++++++++++++++++++++++++++++++