Skip to content


Honor environement (#2949)
Browse files Browse the repository at this point in the history
* Honor environement

Pass environment through SCons. For instance, this is required to pass CCACHE_* variabled to ccache.

* If carrying over all environment variables, no need to handle any individually.
  • Loading branch information
AMDmi3 authored and Endless Sky committed Oct 13, 2017
1 parent 985eabd commit b9b3fab
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions SConstruct
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
import os

# Load any environment variables that alter the build.
env = Environment()
if 'CCFLAGS' in os.environ:
env.Append(CCFLAGS = os.environ['CCFLAGS'])
# Load environment variables, including some that should be renamed.
env = Environment(ENV = os.environ)
if 'CXXFLAGS' in os.environ:
env.Append(CCFLAGS = os.environ['CXXFLAGS'])
if 'CPPFLAGS' in os.environ:
env.Append(CPPFLAGS = os.environ['CPPFLAGS'])
if 'LDFLAGS' in os.environ:
env.Append(LINKFLAGS = os.environ['LDFLAGS'])
if 'CPPPATH' in os.environ:
env.Append(CPPPATH = os.environ['CPPPATH'])

# The Steam runtime has an out-of-date libstdc++, so link it in statically:
if 'SCHROOT_CHROOT_NAME' in os.environ and 'steamrt' in os.environ['SCHROOT_CHROOT_NAME']:
Expand Down Expand Up @@ -56,11 +50,6 @@ else:
env.Append(LIBS = "mad")

# Work with clang's static analyzer:
env["CC"] = os.getenv("CC") or env["CC"]
env["CXX"] = os.getenv("CXX") or env["CXX"]
env["ENV"].update(x for x in os.environ.items() if x[0].startswith("CCC_"))

buildDirectory = env["BUILDDIR"] + "/" + env["mode"]
VariantDir(buildDirectory, "source", duplicate = 0)

Expand Down

0 comments on commit b9b3fab

Please sign in to comment.