From 8bc5916b684d6d9a45961f935ce19d2e1e0c2a87 Mon Sep 17 00:00:00 2001 From: Brian Van Essen Date: Thu, 25 Jan 2018 13:14:48 -0700 Subject: [PATCH] Protobuf package: allow building shared library (#7067) This adds a +shared variant for building shared libraries in the protobuf package and enables it by default. --- var/spack/repos/builtin/packages/protobuf/package.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/var/spack/repos/builtin/packages/protobuf/package.py b/var/spack/repos/builtin/packages/protobuf/package.py index 7453c11cb65..52bb28b4989 100644 --- a/var/spack/repos/builtin/packages/protobuf/package.py +++ b/var/spack/repos/builtin/packages/protobuf/package.py @@ -41,6 +41,9 @@ class Protobuf(CMakePackage): # does not build with CMake: # version('2.5.0', '9c21577a03adc1879aba5b52d06e25cf') + variant('shared', default=True, + description='Enables the build of shared libraries') + depends_on('zlib') conflicts('%gcc@:4.6') # Requires c++11 @@ -62,6 +65,7 @@ def fetch_remote_versions(self): def cmake_args(self): args = [ + '-DBUILD_SHARED_LIBS=%s' % int('+shared' in self.spec), '-Dprotobuf_BUILD_TESTS:BOOL=OFF', '-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON' ]