From 87f78137a54b2d317172e18c1d46a46c31362c6e Mon Sep 17 00:00:00 2001 From: Axel Huebl Date: Mon, 4 May 2020 00:39:20 -0700 Subject: [PATCH] LAPACKC++: added "shared" variant (#16419) We can control the shared/static build of CMake and the default in Spack is to build shared libraries. The old, uncontrolled default of this package is a static build. --- var/spack/repos/builtin/packages/lapackpp/package.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/var/spack/repos/builtin/packages/lapackpp/package.py b/var/spack/repos/builtin/packages/lapackpp/package.py index 1f3ec76924..8b51f233dd 100644 --- a/var/spack/repos/builtin/packages/lapackpp/package.py +++ b/var/spack/repos/builtin/packages/lapackpp/package.py @@ -16,8 +16,16 @@ class Lapackpp(CMakePackage): version('develop', hg=hg, revision="7ffa486") + variant('shared', default=True, + description='Build a shared version of the library') + depends_on('blaspp') def cmake_args(self): - return ['-DBUILD_LAPACKPP_TESTS:BOOL={0}'.format( - 'ON' if self.run_tests else 'OFF')] + spec = self.spec + return [ + '-DBUILD_SHARED_LIBS:BOOL={0}'.format( + 'ON' if '+shared' in spec else 'OFF'), + '-DBUILD_LAPACKPP_TESTS:BOOL={0}'.format( + 'ON' if self.run_tests else 'OFF') + ]