aboutsummaryrefslogtreecommitdiff
path: root/libc/cmake
diff options
context:
space:
mode:
authorJoseph Huber <huberjn@outlook.com>2024-06-03 14:35:06 -0500
committerJoseph Huber <huberjn@outlook.com>2024-06-03 14:37:39 -0500
commitcf3b37c92ffad21086a0741ac682c87abea9a5d6 (patch)
tree13e008b71f98d5db7a2b613b6f52333e916718d6 /libc/cmake
parent07b330132c0b7fd5b3ada1890840d0dbbd8cdb8e (diff)
downloadllvm-cf3b37c92ffad21086a0741ac682c87abea9a5d6.zip
llvm-cf3b37c92ffad21086a0741ac682c87abea9a5d6.tar.gz
llvm-cf3b37c92ffad21086a0741ac682c87abea9a5d6.tar.bz2
[libc] Add GPU utility dependencies if present
Summary: These tools need to be built before we can do the library creation stage. If they are generated in the same build then this is not guaranteed so we should add explicit dependencies.
Diffstat (limited to 'libc/cmake')
-rw-r--r--libc/cmake/modules/LLVMLibCLibraryRules.cmake6
1 files changed, 6 insertions, 0 deletions
diff --git a/libc/cmake/modules/LLVMLibCLibraryRules.cmake b/libc/cmake/modules/LLVMLibCLibraryRules.cmake
index c376faa..75bc81e 100644
--- a/libc/cmake/modules/LLVMLibCLibraryRules.cmake
+++ b/libc/cmake/modules/LLVMLibCLibraryRules.cmake
@@ -132,6 +132,9 @@ function(add_gpu_entrypoint_library target_name base_target_name)
)
add_custom_target(${dep}.__gpubin__ DEPENDS ${dep}
"${CMAKE_CURRENT_BINARY_DIR}/binary/${name}.gpubin")
+ if(TARGET clang-offload-packager)
+ add_dependencies(${dep}.__gpubin__ clang-offload-packager)
+ endif()
# CMake does not permit setting the name on object files. In order to have
# human readable names we create an empty stub file with the entrypoint
@@ -209,6 +212,9 @@ function(add_bitcode_entrypoint_library target_name base_target_name)
)
add_custom_target(${target_name} DEPENDS ${output} ${all_deps})
set_target_properties(${target_name} PROPERTIES TARGET_OBJECT ${output})
+ if(TARGET llvm-link)
+ add_dependencies(${target_name} llvm-link)
+ endif()
endfunction(add_bitcode_entrypoint_library)
# A rule to build a library from a collection of entrypoint objects.