builtin: fix for Windows pipelines
This commit is contained in:
parent
bb90d02d90
commit
787f7d7729
@ -88,7 +88,7 @@ def setup_build_environment(self, env):
|
||||
# devenv is needed to convert ancient MSbuild project to modern
|
||||
# msbuild project so MSBuild versions older than 2010 can build this
|
||||
# project
|
||||
devenv_path = os.path.join(self.pkg.compiler.vs_root, "Common7", "IDE")
|
||||
devenv_path = os.path.join(self.spec["msvc"].package.vs_root, "Common7", "IDE")
|
||||
env.prepend_path("PATH", devenv_path)
|
||||
|
||||
@property
|
||||
|
@ -143,6 +143,70 @@ def _standard_flag(self, *, language: str, standard: str) -> str:
|
||||
}
|
||||
return flags[language][standard]
|
||||
|
||||
@property
|
||||
def short_msvc_version(self):
|
||||
"""This is the shorthand VCToolset version of form
|
||||
MSVC<short-ver>
|
||||
"""
|
||||
return "MSVC" + self.vc_toolset_ver
|
||||
|
||||
@property
|
||||
def vc_toolset_ver(self):
|
||||
"""
|
||||
The toolset version is the version of the combined set of cl and link
|
||||
This typically relates directly to VS version i.e. VS 2022 is v143
|
||||
VS 19 is v142, etc.
|
||||
This value is defined by the first three digits of the major + minor
|
||||
version of the VS toolset (143 for 14.3x.bbbbb). Traditionally the
|
||||
minor version has remained a static two digit number for a VS release
|
||||
series, however, as of VS22, this is no longer true, both
|
||||
14.4x.bbbbb and 14.3x.bbbbb are considered valid VS22 VC toolset
|
||||
versions due to a change in toolset minor version sentiment.
|
||||
|
||||
This is *NOT* the full version, for that see
|
||||
Msvc.msvc_version or MSVC.platform_toolset_ver for the
|
||||
raw platform toolset version
|
||||
|
||||
"""
|
||||
ver = self.msvc_version[:2].joined.string[:3]
|
||||
return ver
|
||||
|
||||
@property
|
||||
def msvc_version(self):
|
||||
"""This is the VCToolset version *NOT* the actual version of the cl compiler"""
|
||||
return spack.version.Version(re.search(Msvc.compiler_version_regex, self.cc).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, "../../../../../../../.."))
|
||||
|
||||
@property
|
||||
def platform_toolset_ver(self):
|
||||
"""
|
||||
This is the platform toolset version of current MSVC compiler
|
||||
i.e. 142. The platform toolset is the targeted MSVC library/compiler
|
||||
versions by compilation (this is different from the VC Toolset)
|
||||
|
||||
|
||||
This is different from the VC toolset version as established
|
||||
by `short_msvc_version`, but typically are represented by the same
|
||||
three digit value
|
||||
"""
|
||||
# Typically VS toolset version and platform toolset versions match
|
||||
# VS22 introduces the first divergence of VS toolset version
|
||||
# (144 for "recent" releases) and platform toolset version (143)
|
||||
# so it needs additional handling until MS releases v144
|
||||
# (assuming v144 is also for VS22)
|
||||
# or adds better support for detection
|
||||
# TODO: (johnwparent) Update this logic for the next platform toolset
|
||||
# or VC toolset version update
|
||||
toolset_ver = self.vc_toolset_ver
|
||||
vs22_toolset = spack.version.Version(toolset_ver) > Version("142")
|
||||
return toolset_ver if not vs22_toolset else "143"
|
||||
|
||||
|
||||
class CmdCall:
|
||||
"""Compose a call to `cmd` for an ordered series of cmd commands/scripts"""
|
||||
|
@ -972,37 +972,37 @@ def with_or_without_ofi(self, activated):
|
||||
def with_or_without_fca(self, activated):
|
||||
if not activated:
|
||||
return "--without-fca"
|
||||
return "--with-fca={0}".format(self.spec["fca"].prefix)
|
||||
return f"--with-fca={self.spec['fca'].prefix}"
|
||||
|
||||
def with_or_without_hcoll(self, activated):
|
||||
if not activated:
|
||||
return "--without-hcoll"
|
||||
return "--with-hcoll={0}".format(self.spec["hcoll"].prefix)
|
||||
return f"--with-hcoll={self.spec['hcoll'].prefix}"
|
||||
|
||||
def with_or_without_ucc(self, activated):
|
||||
if not activated:
|
||||
return "--without-ucc"
|
||||
return "--with-ucc={0}".format(self.spec["ucc"].prefix)
|
||||
return f"--with-ucc={self.spec['ucc'].prefix}"
|
||||
|
||||
def with_or_without_xpmem(self, activated):
|
||||
if not activated:
|
||||
return "--without-xpmem"
|
||||
return "--with-xpmem={0}".format(self.spec["xpmem"].prefix)
|
||||
return f"--with-xpmem={self.spec['xpmem'].prefix}"
|
||||
|
||||
def with_or_without_knem(self, activated):
|
||||
if not activated:
|
||||
return "--without-knem"
|
||||
return "--with-knem={0}".format(self.spec["knem"].prefix)
|
||||
return f"--with-knem={self.spec['knem'].prefix}"
|
||||
|
||||
def with_or_without_lsf(self, activated):
|
||||
if not activated:
|
||||
return "--without-lsf"
|
||||
return "--with-lsf={0}".format(self.spec["lsf"].prefix)
|
||||
return f"--with-lsf={self.spec['lsf'].prefix}"
|
||||
|
||||
def with_or_without_tm(self, activated):
|
||||
if not activated:
|
||||
return "--without-tm"
|
||||
return "--with-tm={0}".format(self.spec["pbs"].prefix)
|
||||
return f"--with-tm={self.spec['pbs'].prefix}"
|
||||
|
||||
@run_before("autoreconf")
|
||||
def die_without_fortran(self):
|
||||
|
Loading…
Reference in New Issue
Block a user