package: add static library build option for yaml-cpp (#15814)

* Add static build option

* Fix flake8 errors and standardize spacing of build commands

Co-authored-by: Carson Woods <carwood@sandia.gov>
This commit is contained in:
Carson Woods 2020-04-01 21:39:04 -04:00 committed by GitHub
parent 814996eebc
commit 9b1820c2de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,6 +23,8 @@ class YamlCpp(CMakePackage):
variant('shared', default=True,
description='Enable build of shared libraries')
variant('static', default=False,
description='Build with static libraries')
variant('pic', default=True,
description='Build with position independent code')
variant('tests', default=False,
@ -65,6 +67,8 @@ def cmake_args(self):
options.extend([
'-DBUILD_SHARED_LIBS:BOOL=%s' % (
'ON' if '+shared' in spec else 'OFF'),
'-DBUILD_STATIC_LIBS=%s' % (
'ON' if '+static' in spec else 'OFF'),
'-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=%s' % (
'ON' if '+pic' in spec else 'OFF'),
'-DYAML_CPP_BUILD_TESTS:BOOL=%s' % (