[llvm] [Offload] Remove unnecessary omp CMake target dependencies (PR #149060)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 16 03:43:18 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-offload

Author: Kenneth Benzie (Benie) (kbenzie)

<details>
<summary>Changes</summary>

In my quest to build `liboffload` with ASAN enabled I've been looking into decoupling `offload` and `openmp` project entablement. When removing `openmp` from `LLVM_ENABLE_PROJECTS` it resulted in failure to link against the `omp` target. As an experiment I disabled that dependency and the build appears to work as expect.

This patch removes dependencies on the `omp` target from `libomptarget`/`llvm-offload-device-info`/`llvm-omp-kernel-replay` targets.


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


3 Files Affected:

- (modified) offload/libomptarget/CMakeLists.txt (-10) 
- (modified) offload/tools/deviceinfo/CMakeLists.txt (-1) 
- (modified) offload/tools/kernelreplay/CMakeLists.txt (-1) 


``````````diff
diff --git a/offload/libomptarget/CMakeLists.txt b/offload/libomptarget/CMakeLists.txt
index 93e684e53bf17..f37e984504167 100644
--- a/offload/libomptarget/CMakeLists.txt
+++ b/offload/libomptarget/CMakeLists.txt
@@ -1,11 +1,5 @@
 message(STATUS "Building offloading runtime library libomptarget.")
 
-if(LIBOMP_STANDALONE)
-  set(LIBOMP ${LIBOMP_STANDALONE})
-else()
-  set(LIBOMP omp)
-endif()
-
 add_llvm_library(omptarget
   SHARED
 
@@ -33,10 +27,6 @@ add_llvm_library(omptarget
   Support
   Object
 
-  LINK_LIBS
-  PUBLIC
-  ${LIBOMP}
-
   NO_INSTALL_RPATH
   BUILDTREE_ONLY
 )
diff --git a/offload/tools/deviceinfo/CMakeLists.txt b/offload/tools/deviceinfo/CMakeLists.txt
index 3787c12f940a6..6edc4f057c8c9 100644
--- a/offload/tools/deviceinfo/CMakeLists.txt
+++ b/offload/tools/deviceinfo/CMakeLists.txt
@@ -8,6 +8,5 @@ target_include_directories(llvm-offload-device-info PRIVATE
   ${LIBOMPTARGET_INCLUDE_DIR}
 )
 target_link_libraries(llvm-offload-device-info PRIVATE
-  omp
   omptarget
 )
diff --git a/offload/tools/kernelreplay/CMakeLists.txt b/offload/tools/kernelreplay/CMakeLists.txt
index 690edd6d5a68e..931b1947fffb4 100644
--- a/offload/tools/kernelreplay/CMakeLists.txt
+++ b/offload/tools/kernelreplay/CMakeLists.txt
@@ -9,6 +9,5 @@ target_include_directories(llvm-omp-kernel-replay PRIVATE
 )
 target_link_libraries(llvm-omp-kernel-replay PRIVATE
   LLVMSupport
-  omp
   omptarget
 )

``````````

</details>


https://github.com/llvm/llvm-project/pull/149060


More information about the llvm-commits mailing list