Introduce offload variant for llvm >= 19. (#45865)

This commit is contained in:
Ye Luo 2024-08-27 12:44:01 -05:00 committed by GitHub
parent 9d8f94a7c8
commit b1af32cb60
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -165,8 +165,12 @@ class Llvm(CMakePackage, CudaPackage, LlvmDetection, CompilerPackage):
"or as a project (with the compiler in use)",
)
variant("offload", default=True, when="@19:", description="Build the Offload subproject")
conflicts("+offload", when="~clang")
variant("libomptarget", default=True, description="Build the OpenMP offloading library")
conflicts("+libomptarget", when="~clang")
conflicts("+libomptarget", when="~offload @19:")
for _p in ["darwin", "windows"]:
conflicts("+libomptarget", when="platform={0}".format(_p))
del _p
@ -912,6 +916,9 @@ def cmake_args(self):
elif "openmp=project" in spec:
projects.append("openmp")
if "+offload" in spec:
runtimes.append("offload")
if "+libomptarget" in spec:
cmake_args.append(define("OPENMP_ENABLE_LIBOMPTARGET", True))
else: