Merge pull request #46815 from akien-mga/3.2-scons-fix-env-creation

[3.2] SCons: Use default env["ENV"] and prepend PATH to it
This commit is contained in:
Rémi Verschelde 2021-03-09 11:20:28 +01:00 committed by GitHub
commit 20a6bb8509
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -61,14 +61,15 @@ elif platform_arg == "javascript":
# Use generic POSIX build toolchain for Emscripten.
custom_tools = ["cc", "c++", "ar", "link", "textfile", "zip"]
env_base = Environment(
ENV={
"PATH": os.getenv("PATH"),
"PKG_CONFIG_PATH": os.getenv("PKG_CONFIG_PATH"),
"TERM": os.getenv("TERM"),
},
tools=custom_tools,
)
# We let SCons build its default ENV as it includes OS-specific things which we don't
# want to have to pull in manually.
# Then we prepend PATH to make it take precedence, while preserving SCons' own entries.
env_base = Environment(tools=custom_tools)
env_base.PrependENVPath("PATH", os.getenv("PATH"))
env_base.PrependENVPath("PKG_CONFIG_PATH", os.getenv("PKG_CONFIG_PATH"))
if "TERM" in os.environ: # Used for colored output.
env_base["ENV"]["TERM"] = os.environ["TERM"]
env_base.disabled_modules = []
env_base.use_ptrcall = False
env_base.module_version_string = ""