From cd42fc5cc8dfda473643f40d359fc3d68d7906fb Mon Sep 17 00:00:00 2001 From: "John W. Parent" <45471568+johnwparent@users.noreply.github.com> Date: Tue, 14 Mar 2023 19:46:49 -0400 Subject: Libogg and libtheora: build on windows (#35099) Adds builders appropriate for building these packages on Windows. It is intended that builds on other platforms are unaffected (e.g. they build with Autotools as before on Linux). --- lib/spack/spack/compilers/msvc.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'lib') 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 -- cgit v1.2.3-60-g2f50