Skip to content

Commit b9b3fab

Browse files
AMDmi3Endless Sky
authored andcommitted
Honor environement (#2949)
* 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.
1 parent 985eabd commit b9b3fab

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

SConstruct

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
11
import os
22

3-
# Load any environment variables that alter the build.
4-
env = Environment()
5-
if 'CCFLAGS' in os.environ:
6-
env.Append(CCFLAGS = os.environ['CCFLAGS'])
3+
# Load environment variables, including some that should be renamed.
4+
env = Environment(ENV = os.environ)
75
if 'CXXFLAGS' in os.environ:
86
env.Append(CCFLAGS = os.environ['CXXFLAGS'])
9-
if 'CPPFLAGS' in os.environ:
10-
env.Append(CPPFLAGS = os.environ['CPPFLAGS'])
117
if 'LDFLAGS' in os.environ:
128
env.Append(LINKFLAGS = os.environ['LDFLAGS'])
13-
if 'CPPPATH' in os.environ:
14-
env.Append(CPPPATH = os.environ['CPPPATH'])
159

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

5852

59-
# Work with clang's static analyzer:
60-
env["CC"] = os.getenv("CC") or env["CC"]
61-
env["CXX"] = os.getenv("CXX") or env["CXX"]
62-
env["ENV"].update(x for x in os.environ.items() if x[0].startswith("CCC_"))
63-
6453
buildDirectory = env["BUILDDIR"] + "/" + env["mode"]
6554
VariantDir(buildDirectory, "source", duplicate = 0)
6655

0 commit comments

Comments
 (0)