summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn W. Parent <45471568+johnwparent@users.noreply.github.com>2023-02-03 20:53:24 -0500
committerGitHub <noreply@github.com>2023-02-03 17:53:24 -0800
commit1826a41cddd64b8a7cd15c2ad8a5f9a8eaa391e5 (patch)
treeac998a6a434abbd5fbfed4e4ac9e6012a2a1a320
parent509a8ea5e29528e0bdee83b38d62d9370989c211 (diff)
downloadspack-1826a41cddd64b8a7cd15c2ad8a5f9a8eaa391e5.tar.gz
spack-1826a41cddd64b8a7cd15c2ad8a5f9a8eaa391e5.tar.bz2
spack-1826a41cddd64b8a7cd15c2ad8a5f9a8eaa391e5.tar.xz
spack-1826a41cddd64b8a7cd15c2ad8a5f9a8eaa391e5.zip
MSVC compiler: add platform toolset version (#35098)
-rw-r--r--lib/spack/spack/compilers/msvc.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/spack/spack/compilers/msvc.py b/lib/spack/spack/compilers/msvc.py
index 91ebc8f25f..7a8432ecfa 100644
--- a/lib/spack/spack/compilers/msvc.py
+++ b/lib/spack/spack/compilers/msvc.py
@@ -103,12 +103,23 @@ class Msvc(Compiler):
"""
This is the shorthand VCToolset version of form
MSVC<short-ver> *NOT* the full version, for that see
- Msvc.msvc_version
+ Msvc.msvc_version or MSVC.platform_toolset_ver for the
+ raw platform toolset version
"""
- ver = self.msvc_version[:2].joined.string[:3]
+ ver = self.platform_toolset_ver
return "MSVC" + ver
@property
+ def platform_toolset_ver(self):
+ """
+ This is the platform toolset version of current MSVC compiler
+ i.e. 142.
+ This is different from the VC toolset version as established
+ by `short_msvc_version`
+ """
+ return self.msvc_version[:2].joined.string[:3]
+
+ @property
def cl_version(self):
"""Cl toolset version"""
return spack.compiler.get_compiler_version_output(self.cc)