fmt: add variant for shared library (#25969)
This commit is contained in:
parent
730720d50a
commit
7e7de25aba
@ -35,7 +35,8 @@ class Fmt(CMakePackage):
|
|||||||
values=('98', '11', '14', '17'),
|
values=('98', '11', '14', '17'),
|
||||||
multi=False,
|
multi=False,
|
||||||
description='Use the specified C++ standard when building')
|
description='Use the specified C++ standard when building')
|
||||||
variant('pic', default=True, description='Enable generation of position-independent code')
|
variant('shared', default=False, description='Build shared library')
|
||||||
|
variant('pic', default=True, description='Build position-independent code')
|
||||||
|
|
||||||
depends_on('cmake@3.1.0:', type='build')
|
depends_on('cmake@3.1.0:', type='build')
|
||||||
|
|
||||||
@ -63,6 +64,9 @@ def cmake_args(self):
|
|||||||
spec = self.spec
|
spec = self.spec
|
||||||
args = []
|
args = []
|
||||||
|
|
||||||
|
if self.spec.satisfies('+shared'):
|
||||||
|
args.append('-DBUILD_SHARED_LIBS=ON')
|
||||||
|
|
||||||
if '+pic' in spec:
|
if '+pic' in spec:
|
||||||
args.extend([
|
args.extend([
|
||||||
'-DCMAKE_C_FLAGS={0}'.format(self.compiler.cc_pic_flag),
|
'-DCMAKE_C_FLAGS={0}'.format(self.compiler.cc_pic_flag),
|
||||||
|
Loading…
Reference in New Issue
Block a user