parquet: add -fPIC option (#9367)

This adds a pic variant and also exports all compiler flags as CMake
arguments
This commit is contained in:
Matthias Wolf 2018-10-18 22:12:56 +02:00 committed by Peter Scheibel
parent 48c7ee37c1
commit b1849f9c8b

View File

@ -21,6 +21,8 @@ class Parquet(CMakePackage):
depends_on('pkgconfig', type='build') depends_on('pkgconfig', type='build')
depends_on('thrift+pic') depends_on('thrift+pic')
variant('pic', default=True,
description='Build position independent code')
variant('build_type', default='Release', variant('build_type', default='Release',
description='CMake build type', description='CMake build type',
values=('Debug', 'FastDebug', 'Release')) values=('Debug', 'FastDebug', 'Release'))
@ -31,3 +33,9 @@ def cmake_args(self):
args.append("-D{0}_HOME={1}".format(dep.upper(), args.append("-D{0}_HOME={1}".format(dep.upper(),
self.spec[dep].prefix)) self.spec[dep].prefix))
return args return args
def flag_handler(self, name, flags):
flags = list(flags)
if '+pic' in self.spec and name in ('cflags', 'cxxflags'):
flags.append(self.compiler.pic_flag)
return (None, None, flags)