Skip to content
Snippets Groups Projects
Commit 8bc5916b authored by Brian Van Essen's avatar Brian Van Essen Committed by scheibelp
Browse files

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.
parent 82d4d58c
Branches
Tags
No related merge requests found
...@@ -41,6 +41,9 @@ class Protobuf(CMakePackage): ...@@ -41,6 +41,9 @@ class Protobuf(CMakePackage):
# does not build with CMake: # does not build with CMake:
# version('2.5.0', '9c21577a03adc1879aba5b52d06e25cf') # version('2.5.0', '9c21577a03adc1879aba5b52d06e25cf')
variant('shared', default=True,
description='Enables the build of shared libraries')
depends_on('zlib') depends_on('zlib')
conflicts('%gcc@:4.6') # Requires c++11 conflicts('%gcc@:4.6') # Requires c++11
...@@ -62,6 +65,7 @@ def fetch_remote_versions(self): ...@@ -62,6 +65,7 @@ def fetch_remote_versions(self):
def cmake_args(self): def cmake_args(self):
args = [ args = [
'-DBUILD_SHARED_LIBS=%s' % int('+shared' in self.spec),
'-Dprotobuf_BUILD_TESTS:BOOL=OFF', '-Dprotobuf_BUILD_TESTS:BOOL=OFF',
'-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON' '-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON'
] ]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment