summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/wgl/package.py
diff options
context:
space:
mode:
Diffstat (limited to 'var/spack/repos/builtin/packages/wgl/package.py')
-rw-r--r--var/spack/repos/builtin/packages/wgl/package.py20
1 files changed, 17 insertions, 3 deletions
diff --git a/var/spack/repos/builtin/packages/wgl/package.py b/var/spack/repos/builtin/packages/wgl/package.py
index 17be11243d..9d02f3c139 100644
--- a/var/spack/repos/builtin/packages/wgl/package.py
+++ b/var/spack/repos/builtin/packages/wgl/package.py
@@ -14,7 +14,7 @@ class Wgl(Package):
homepage = "https://learn.microsoft.com/en-us/windows/win32/opengl/wgl-and-windows-reference"
has_code = False
- tags = ["windows"]
+ tags = ["windows", "windows-system"]
# hard code the extension as shared lib
libraries = ["OpenGL32.Lib"]
@@ -36,6 +36,10 @@ class Wgl(Package):
version("10.0.26639")
version("10.0.20348")
+ variant(
+ "plat", values=("x64", "x86", "arm", "arm64"), default="x64", description="Toolchain arch"
+ )
+
# As per https://github.com/spack/spack/pull/31748 this provisory version represents
# an arbitrary openGL version designed for maximum compatibility with calling packages
# this current version simply reflects the latest OpenGL vesion available at the time of
@@ -58,7 +62,7 @@ class Wgl(Package):
depends_on("win-sdk@10.0.14393", when="@10.0.14393")
# WGL has no meaning on other platforms, should not be able to spec
- for plat in ["linux", "darwin", "cray"]:
+ for plat in ["linux", "darwin"]:
conflicts("platform=%s" % plat)
@classmethod
@@ -68,8 +72,18 @@ class Wgl(Package):
ver_str = re.search(version_match_pat, lib)
return ver_str if not ver_str else Version(ver_str.group())
+ @classmethod
+ def determine_variants(cls, libs, ver_str):
+ """Allow for determination of toolchain arch for detected WGL"""
+ variants = []
+ for lib in libs:
+ base, lib_name = os.path.split(lib)
+ _, arch = os.path.split(base)
+ variants.append("plat=%s" % arch)
+ return variants
+
def _spec_arch_to_sdk_arch(self):
- spec_arch = str(self.spec.architecture.target).lower()
+ spec_arch = str(self.spec.architecture.target.family).lower()
_64bit = "64" in spec_arch
arm = "arm" in spec_arch
if arm: