jansson: enable shared library (#5857)

Jansson builds only a static library by default, which is probably
not what most users want. Add Cmake args required to build a shared
library and enable those via a default 'shared' variant of the
package.
This commit is contained in:
Mark Grondona 2017-10-23 04:32:51 -07:00 committed by Todd Gamblin
parent 3e7680e24a
commit 328dc3d140

View file

@ -33,3 +33,12 @@ class Jansson(CMakePackage):
url = "https://github.com/akheron/jansson/archive/v2.9.tar.gz" url = "https://github.com/akheron/jansson/archive/v2.9.tar.gz"
version('2.9', 'd2db25c437b359fc5a065ed938962237') version('2.9', 'd2db25c437b359fc5a065ed938962237')
variant('shared', default=True,
description='Enables the build of shared libraries')
def cmake_args(self):
return [
'-DJANSSON_BUILD_SHARED_LIBS:BOOL=%s' % (
'ON' if '+shared' in self.spec else 'OFF'),
]