summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Demarchi Gomes <pedrodemargomes@gmail.com>2021-10-07 20:01:40 -0300
committerGitHub <noreply@github.com>2021-10-08 01:01:40 +0200
commit28529f9eaf59a0ad98eeecd07d3572fcb96057c4 (patch)
treed82ecd9b1994b286d8a1ebd8fa4859de14b744cd
parentda31c7e894b4042e893d361e3c6dbbf2d38805b6 (diff)
downloadspack-28529f9eaf59a0ad98eeecd07d3572fcb96057c4.tar.gz
spack-28529f9eaf59a0ad98eeecd07d3572fcb96057c4.tar.bz2
spack-28529f9eaf59a0ad98eeecd07d3572fcb96057c4.tar.xz
spack-28529f9eaf59a0ad98eeecd07d3572fcb96057c4.zip
re2 pic support (#26513)
-rw-r--r--var/spack/repos/builtin/packages/grpc/package.py3
-rw-r--r--var/spack/repos/builtin/packages/re2/package.py8
2 files changed, 8 insertions, 3 deletions
diff --git a/var/spack/repos/builtin/packages/grpc/package.py b/var/spack/repos/builtin/packages/grpc/package.py
index 40ee6574bd..f7ad7d21f9 100644
--- a/var/spack/repos/builtin/packages/grpc/package.py
+++ b/var/spack/repos/builtin/packages/grpc/package.py
@@ -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 = [
diff --git a/var/spack/repos/builtin/packages/re2/package.py b/var/spack/repos/builtin/packages/re2/package.py
index 61a5d595ef..bcae22283e 100644
--- a/var/spack/repos/builtin/packages/re2/package.py
+++ b/var/spack/repos/builtin/packages/re2/package.py
@@ -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