diff options
author | Dan Lipsa <dan.lipsa@kitware.com> | 2023-06-30 13:10:18 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-30 10:10:18 -0700 |
commit | e6c94e91269520dd324820e43dd89abeee08b508 (patch) | |
tree | 760fcf09dd8d48b0abd58bdff307ad0289eff4f0 | |
parent | af5b93bb97bf1c49238d5563aa0691fdeed5bae3 (diff) | |
download | spack-e6c94e91269520dd324820e43dd89abeee08b508.tar.gz spack-e6c94e91269520dd324820e43dd89abeee08b508.tar.bz2 spack-e6c94e91269520dd324820e43dd89abeee08b508.tar.xz spack-e6c94e91269520dd324820e43dd89abeee08b508.zip |
XZ package (Windows): install .dll files in bin (#35888)
Windows runtime library loading searches PATH, and therefore bin/ is
the appropriate place to put .dll files. Prior to this change, XZ was
installing both .dll and .lib files to the lib/ directory.
-rw-r--r-- | var/spack/repos/builtin/packages/xz/package.py | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/var/spack/repos/builtin/packages/xz/package.py b/var/spack/repos/builtin/packages/xz/package.py index 560604a781..301792b24f 100644 --- a/var/spack/repos/builtin/packages/xz/package.py +++ b/var/spack/repos/builtin/packages/xz/package.py @@ -111,18 +111,26 @@ class MSBuildBuilder(MSBuildBuilder): def install(self, pkg, spec, prefix): with working_dir(self.build_directory): - # Ensure we have libs directory mkdirp(prefix.lib) + mkdirp(prefix.bin) libs_to_find = [] - if "libs=shared" in self.pkg.spec: - libs_to_find.extend(["*.dll", "*.lib"]) - else: + dlls_to_find = [] + if self.pkg.spec.satisfies("libs=shared"): + dlls_to_find.append("*.dll") + if self.pkg.spec.satisfies("libs=static"): libs_to_find.append("*.lib") for lib in libs_to_find: libs_to_install = glob.glob( os.path.join(self.build_directory, "**", lib), recursive=True ) - for library in libs_to_install: - install(library, prefix.lib) + for lib_to_install in libs_to_install: + install(lib_to_install, prefix.lib) + for dll in dlls_to_find: + dlls_to_install = glob.glob( + os.path.join(self.build_directory, "**", dll), recursive=True + ) + for dll_to_install in dlls_to_install: + install(dll_to_install, prefix.bin) + with working_dir(pkg.stage.source_path): install_tree(os.path.join("src", "liblzma", "api"), prefix.include) |