llvm: make "omp_as_runtime" variant conditional (#30782)

fixes #30700

To avoid clingo adding penalties for not using the
default value for a variant, it's better to model
the variant as conditional where possible.
This commit is contained in:
Massimiliano Culpo 2022-05-23 14:21:11 +02:00 committed by GitHub
parent 7ded692a76
commit 3bc656808c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -165,6 +165,7 @@ class Llvm(CMakePackage, CudaPackage):
variant( variant(
"omp_as_runtime", "omp_as_runtime",
default=True, default=True,
when='+clang @12:',
description="Build OpenMP runtime via ENABLE_RUNTIME by just-built Clang", description="Build OpenMP runtime via ENABLE_RUNTIME by just-built Clang",
) )
variant('code_signing', default=False, variant('code_signing', default=False,
@ -268,10 +269,6 @@ class Llvm(CMakePackage, CudaPackage):
# OMP TSAN exists in > 5.x # OMP TSAN exists in > 5.x
conflicts("+omp_tsan", when="@:5") conflicts("+omp_tsan", when="@:5")
# OpenMP via ENABLE_RUNTIME restrictions
conflicts("+omp_as_runtime", when="~clang", msg="omp_as_runtime requires clang being built.")
conflicts("+omp_as_runtime", when="@:11.1", msg="omp_as_runtime works since LLVM 12.")
# cuda_arch value must be specified # cuda_arch value must be specified
conflicts("cuda_arch=none", when="+cuda", msg="A value for cuda_arch must be specified.") conflicts("cuda_arch=none", when="+cuda", msg="A value for cuda_arch must be specified.")