re2 pic support (#26513)

This commit is contained in:
Pedro Demarchi Gomes 2021-10-07 20:01:40 -03:00 committed by GitHub
parent da31c7e894
commit 28529f9eaf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View file

@ -51,8 +51,7 @@ class Grpc(CMakePackage):
depends_on('zlib')
depends_on('c-ares')
depends_on('abseil-cpp', when='@1.27:')
depends_on('re2+shared', when='@1.33.1:+shared')
depends_on('re2', when='@1.33.1:')
depends_on('re2+pic', when='@1.33.1:')
def cmake_args(self):
args = [

View file

@ -19,9 +19,15 @@ class Re2(CMakePackage):
variant('shared', default=False,
description='Build shared instead of static libraries')
variant('pic', default=True,
description='Enable position independent code')
# shared libs must have position-independent code
conflicts('+shared ~pic')
def cmake_args(self):
args = [
self.define_from_variant('BUILD_SHARED_LIBS', 'shared')
self.define_from_variant('BUILD_SHARED_LIBS', 'shared'),
self.define_from_variant('CMAKE_POSITION_INDEPENDENT_CODE', 'pic')
]
return args