diff options
-rw-r--r-- | etc/spack/defaults/windows/packages.yaml | 1 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/wgl/package.py | 27 |
2 files changed, 24 insertions, 4 deletions
diff --git a/etc/spack/defaults/windows/packages.yaml b/etc/spack/defaults/windows/packages.yaml index 863cf7cf18..c72ba8c033 100644 --- a/etc/spack/defaults/windows/packages.yaml +++ b/etc/spack/defaults/windows/packages.yaml @@ -19,3 +19,4 @@ packages: - msvc providers: mpi: [msmpi] + gl: [wgl] diff --git a/var/spack/repos/builtin/packages/wgl/package.py b/var/spack/repos/builtin/packages/wgl/package.py index bbad4bf987..7468b6f577 100644 --- a/var/spack/repos/builtin/packages/wgl/package.py +++ b/var/spack/repos/builtin/packages/wgl/package.py @@ -34,6 +34,7 @@ class Wgl(Package): version("10.0.14393") version("10.0.10586") version("10.0.26639") + version("10.0.20348") # As per https://github.com/spack/spack/pull/31748 this provisory version represents # an arbitrary openGL version designed for maximum compatibility with calling packages @@ -42,12 +43,12 @@ class Wgl(Package): # satisfied appropriately provides("gl@4.6") - variant("plat", values=("x64", "x86", "arm", "arm64"), default="x64") - # WGL exists on all Windows systems post win 98, however the headers # needed to use OpenGL are found in the SDK (GL/gl.h) # Dep is needed to consolidate sdk version to locate header files for # version of SDK being used + # Generic depends to capture handling for external versions + depends_on("win-sdk") depends_on("win-sdk@10.0.19041", when="@10.0.19041") depends_on("win-sdk@10.0.18362", when="@10.0.18362") depends_on("win-sdk@10.0.17763", when="@10.0.17763") @@ -77,14 +78,32 @@ class Wgl(Package): variants.append("plat=%s" % arch) return variants + def _spec_arch_to_sdk_arch(self): + spec_arch = str(self.spec.architecture.target).lower() + _64bit = "64" in spec_arch + arm = "arm" in spec_arch + if arm: + return "arm64" if _64bit else "arm" + else: + return "x64" if _64bit else "x86" + # As noted above, the headers neccesary to include @property def headers(self): - return find_headers("GL/gl.h", root=self.spec["win-sdk"].prefix.includes, recursive=True) + return find_headers( + "GL", root=os.path.join(self.prefix.Include, str(self.version) + ".0"), recursive=True + ) @property def libs(self): - return find_libraries("opengl32", shared=False, root=self.prefix, recursive=True) + return find_libraries( + "opengl32", + shared=False, + root=os.path.join( + self.prefix.Lib, str(self.version) + ".0", "um", self._spec_arch_to_sdk_arch() + ), + recursive=True, + ) def install(self, spec, prefix): raise RuntimeError( |