[Offload] Fix CMake detection when it is not found (#90729)

Summary:
This variable could be unset if not found or when building standalone.
We should check for that and set it to true or false.

Fixes: https://github.com/llvm/llvm-project/issues/90708
This commit is contained in:
Joseph Huber 2024-05-01 09:05:18 -05:00 committed by GitHub
parent 0647b2a3ca
commit e312f0723c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -302,7 +302,12 @@ endif()
pythonize_bool(LIBOMPTARGET_OMPT_SUPPORT)
set(LIBOMPTARGET_GPU_LIBC_SUPPORT ${LLVM_LIBC_GPU_BUILD} CACHE BOOL
if(${LLVM_LIBC_GPU_BUILD})
set(LIBOMPTARGET_HAS_LIBC TRUE)
else()
set(LIBOMPTARGET_HAS_LIBC FALSE)
endif()
set(LIBOMPTARGET_GPU_LIBC_SUPPORT ${LIBOMPTARGET_HAS_LIBC} CACHE BOOL
"Libomptarget support for the GPU libc")
pythonize_bool(LIBOMPTARGET_GPU_LIBC_SUPPORT)