summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-03-11 12:38:53 +0100
committerGitHub <noreply@github.com>2021-03-11 12:38:53 +0100
commit5024b7236e8cd36087b34bd3a3c9f8481bafb1e0 (patch)
tree76fedee8f240882d971bd7cae06ef5d71b54b415
parentdc0d1ab3b56ed635490ad0c2d8b388e24691df57 (diff)
parentb7ebd22314f72c1021bd75efd14583089027558f (diff)
Merge pull request #46859 from akien-mga/scons-more-env-woes
SCons: Use default env["ENV"] and prepend PATH to it
-rw-r--r--SConstruct10
1 files changed, 8 insertions, 2 deletions
diff --git a/SConstruct b/SConstruct
index 1fec033881..b006dddbe6 100644
--- a/SConstruct
+++ b/SConstruct
@@ -61,8 +61,14 @@ elif platform_arg == "javascript":
# Use generic POSIX build toolchain for Emscripten.
custom_tools = ["cc", "c++", "ar", "link", "textfile", "zip"]
-# Construct the environment using the user's host env variables.
-env_base = Environment(ENV=os.environ, 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.module_version_string = ""