Skip to content

Commit e312f07

Browse files
authored
[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: #90708
1 parent 0647b2a commit e312f07

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

offload/CMakeLists.txt

+6-1
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,12 @@ endif()
302302

303303
pythonize_bool(LIBOMPTARGET_OMPT_SUPPORT)
304304

305-
set(LIBOMPTARGET_GPU_LIBC_SUPPORT ${LLVM_LIBC_GPU_BUILD} CACHE BOOL
305+
if(${LLVM_LIBC_GPU_BUILD})
306+
set(LIBOMPTARGET_HAS_LIBC TRUE)
307+
else()
308+
set(LIBOMPTARGET_HAS_LIBC FALSE)
309+
endif()
310+
set(LIBOMPTARGET_GPU_LIBC_SUPPORT ${LIBOMPTARGET_HAS_LIBC} CACHE BOOL
306311
"Libomptarget support for the GPU libc")
307312
pythonize_bool(LIBOMPTARGET_GPU_LIBC_SUPPORT)
308313

0 commit comments

Comments
 (0)