From 97bc86d6175472ad8c154921b021ee2c277d642c Mon Sep 17 00:00:00 2001 From: Michael Kuhn Date: Thu, 28 Sep 2017 22:18:50 +0200 Subject: [PATCH] snappy: Build shared library by default (#5534) --- var/spack/repos/builtin/packages/snappy/package.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/var/spack/repos/builtin/packages/snappy/package.py b/var/spack/repos/builtin/packages/snappy/package.py index ba13a90e5c..7a46c24b83 100644 --- a/var/spack/repos/builtin/packages/snappy/package.py +++ b/var/spack/repos/builtin/packages/snappy/package.py @@ -33,6 +33,20 @@ class Snappy(CMakePackage): version('1.1.7', 'ee9086291c9ae8deb4dac5e0b85bf54a') + variant('shared', default=True, description='Build shared libraries') + + def cmake_args(self): + spec = self.spec + + args = [ + '-DCMAKE_INSTALL_LIBDIR:PATH={0}'.format( + self.prefix.lib), + '-DBUILD_SHARED_LIBS:BOOL={0}'.format( + 'ON' if '+shared' in spec else 'OFF') + ] + + return args + @run_after('install') def install_pkgconfig(self): mkdirp(self.prefix.lib.pkgconfig)