diff options
author | Martin Robinson <mrobinson@igalia.com> | 2023-08-16 13:14:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-16 11:14:14 +0000 |
commit | 46978b2543e1515c4dcac0e936585aaeed67007a (patch) | |
tree | 55cc60d4f69774e75378f89b5946203ed4339180 /python/servo/command_base.py | |
parent | d6ae8dc112deb479f345c94970dde442332c8c27 (diff) | |
download | servo-46978b2543e1515c4dcac0e936585aaeed67007a.tar.gz servo-46978b2543e1515c4dcac0e936585aaeed67007a.zip |
Clean up the environment variables set for mozjs (#30106)
mozjs from the repository now has a simplified interface for setting
these.
Diffstat (limited to 'python/servo/command_base.py')
-rw-r--r-- | python/servo/command_base.py | 31 |
1 files changed, 8 insertions, 23 deletions
diff --git a/python/servo/command_base.py b/python/servo/command_base.py index 3890d3b69c7..0b51070b4f3 100644 --- a/python/servo/command_base.py +++ b/python/servo/command_base.py @@ -466,40 +466,25 @@ class CommandBase(object): env, cross_compilation_target=self.cross_compile_target, check_installation=is_build) - extra_path = [] effective_target = self.cross_compile_target or servo.platform.host_triple() if "msvc" in effective_target: - extra_path += [path.join(self.msvc_package_dir("llvm"), "bin")] - env.setdefault("CC", "clang-cl.exe") - env.setdefault("CXX", "clang-cl.exe") + util.append_paths_to_env(env, "PATH", path.join(self.msvc_package_dir("llvm"), "bin")) - # Link moztools, used for building SpiderMonkey - moztools_paths = [ - path.join(self.msvc_package_dir("moztools"), "bin"), - path.join(self.msvc_package_dir("moztools"), "msys", "bin"), - ] - # In certain cases we need to ensure that tools with conflicting MSYS versions - # can be placed in the PATH ahead of the moztools directories. - moztools_path_prepend = env.get("MOZTOOLS_PATH_PREPEND", None) - if moztools_path_prepend: - moztools_paths.insert(0, moztools_path_prepend) - env["MOZTOOLS_PATH"] = os.pathsep.join(moztools_paths) - # Link autoconf 2.13, used for building SpiderMonkey - env["AUTOCONF"] = path.join(self.msvc_package_dir("moztools"), "msys", "local", "bin", "autoconf-2.13") - # Link LLVM + # These two environment variables are necessary for building mozjs. It would + # be nice to be able to set them in the cargo configuration somehow, but they + # are platform-dependent. env["LIBCLANG_PATH"] = path.join(self.msvc_package_dir("llvm"), "lib") + env["MOZILLA_BUILD"] = path.join(self.msvc_package_dir("moztools")) - if not os.environ.get("NATIVE_WIN32_PYTHON"): - env["NATIVE_WIN32_PYTHON"] = sys.executable # Always build harfbuzz from source env["HARFBUZZ_SYS_NO_PKG_CONFIG"] = "true" if sys.platform != "win32": env.setdefault("CC", "clang") env.setdefault("CXX", "clang++") - - if extra_path: - util.append_paths_to_env(env, "PATH", extra_path) + else: + env.setdefault("CC", "clang-cl.exe") + env.setdefault("CXX", "clang-cl.exe") if self.config["build"]["incremental"]: env["CARGO_INCREMENTAL"] = "1" |