summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/compilers/msvc.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/spack/spack/compilers/msvc.py b/lib/spack/spack/compilers/msvc.py
index 7a8432ecfa..9be10b0826 100644
--- a/lib/spack/spack/compilers/msvc.py
+++ b/lib/spack/spack/compilers/msvc.py
@@ -122,7 +122,19 @@ class Msvc(Compiler):
@property
def cl_version(self):
"""Cl toolset version"""
- return spack.compiler.get_compiler_version_output(self.cc)
+ return Version(
+ re.search(
+ Msvc.version_regex,
+ spack.compiler.get_compiler_version_output(self.cc, version_arg=None),
+ ).group(1)
+ )
+
+ @property
+ def vs_root(self):
+ # The MSVC install root is located at a fix level above the compiler
+ # and is referenceable idiomatically via the pattern below
+ # this should be consistent accross versions
+ return os.path.abspath(os.path.join(self.cc, "../../../../../../../.."))
def setup_custom_environment(self, pkg, env):
"""Set environment variables for MSVC using the