summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Van Essen <vanessen1@llnl.gov>2018-01-25 13:14:48 -0700
committerscheibelp <scheibel1@llnl.gov>2018-01-25 12:14:48 -0800
commit8bc5916b684d6d9a45961f935ce19d2e1e0c2a87 (patch)
tree2c22995782e4de99bdc27614c7fbbf1958e90d37
parent82d4d58ca70f4cbd112dbae257014439276925ef (diff)
downloadspack-8bc5916b684d6d9a45961f935ce19d2e1e0c2a87.tar.gz
spack-8bc5916b684d6d9a45961f935ce19d2e1e0c2a87.tar.bz2
spack-8bc5916b684d6d9a45961f935ce19d2e1e0c2a87.tar.xz
spack-8bc5916b684d6d9a45961f935ce19d2e1e0c2a87.zip
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.
-rw-r--r--var/spack/repos/builtin/packages/protobuf/package.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/protobuf/package.py b/var/spack/repos/builtin/packages/protobuf/package.py
index 7453c11cb6..52bb28b498 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 @@ class Protobuf(CMakePackage):
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'
]