diff options
author | John W. Parent <45471568+johnwparent@users.noreply.github.com> | 2023-04-11 19:04:34 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-11 19:04:34 -0400 |
commit | 530669346ab0a9ae9931d2e980c7d38325e43b99 (patch) | |
tree | 599417381130872b9546bb01ca429bac66bc2b76 /lib | |
parent | 68f50f9b11854f3de7b2fe094d6d6fee75bdd0d3 (diff) | |
download | spack-530669346ab0a9ae9931d2e980c7d38325e43b99.tar.gz spack-530669346ab0a9ae9931d2e980c7d38325e43b99.tar.bz2 spack-530669346ab0a9ae9931d2e980c7d38325e43b99.tar.xz spack-530669346ab0a9ae9931d2e980c7d38325e43b99.zip |
Windows/MSVC: propagate all VCVARS changes to Spack env (#36582)
MSVC compilers rely on vcvars environment setup scripts to establish
build environement variables neccesary for all projects to build
successfully. Prior to this we were only piping LIB, INCLUDE, and PATH
change through.
Instead we need to propegate all changes to the env variables made by
VCVARs in order to establish robust support for the MSVC compiler.
This most significantly impacts projects that need to be build with
NMake and MSBuild
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/compilers/msvc.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/spack/spack/compilers/msvc.py b/lib/spack/spack/compilers/msvc.py index 9be10b0826..061555a500 100644 --- a/lib/spack/spack/compilers/msvc.py +++ b/lib/spack/spack/compilers/msvc.py @@ -169,10 +169,11 @@ class Msvc(Compiler): if key and value ) - if "path" in int_env: - env.set_path("PATH", int_env["path"].split(";")) - env.set_path("INCLUDE", int_env.get("include", "").split(";")) - env.set_path("LIB", int_env.get("lib", "").split(";")) + for env_var in int_env: + if os.pathsep not in int_env[env_var]: + env.set(env_var, int_env[env_var]) + else: + env.set_path(env_var, int_env[env_var].split(os.pathsep)) env.set("CC", self.cc) env.set("CXX", self.cxx) |