Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
May 1, 2024

Conversation

jhuber6
Copy link
Contributor

@jhuber6 jhuber6 commented May 1, 2024

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

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: llvm#90708
@llvmbot
Copy link
Collaborator

llvmbot commented May 1, 2024

@llvm/pr-subscribers-offload

Author: Joseph Huber (jhuber6)

Changes

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


Full diff: https://github.com/llvm/llvm-project/pull/90729.diff

1 Files Affected:

  • (modified) offload/CMakeLists.txt (+6-1)
diff --git a/offload/CMakeLists.txt b/offload/CMakeLists.txt
index a416ac29873f4f..42e0f5740f116d 100644
--- a/offload/CMakeLists.txt
+++ b/offload/CMakeLists.txt
@@ -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)
 

@sylvestre
Copy link
Collaborator

LGTM
i am now failing on #90707

Copy link
Contributor

@estewart08 estewart08 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jhuber6 jhuber6 merged commit e312f07 into llvm:main May 1, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

offload: cryptic error message when -DLLVM_LIBC_GPU_BUILD=ON is not set
4 participants