[Openmp-commits] [PATCH] D153628: OpenMP/cmake: Use TARGET_FILE instead of looking for amdgpu-arch
Matt Arsenault via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Fri Jun 23 06:57:32 PDT 2023
arsenm created this revision.
arsenm added reviewers: JonChesterfield, saiislam, ronlieb, jdoerfert.
Herald added subscribers: sunshaoce, guansong, tpr, dstuttard, yaxunl, kzhuravl.
Herald added a project: All.
arsenm requested review of this revision.
Herald added subscribers: jplehr, sstefan1, wdng.
Not sure if the standalone build case is supposed to be a supported
path. Should probably rely on find_package and imported targets
anyway.
https://reviews.llvm.org/D153628
Files:
openmp/libomptarget/cmake/Modules/LibomptargetGetDependencies.cmake
Index: openmp/libomptarget/cmake/Modules/LibomptargetGetDependencies.cmake
===================================================================
--- openmp/libomptarget/cmake/Modules/LibomptargetGetDependencies.cmake
+++ openmp/libomptarget/cmake/Modules/LibomptargetGetDependencies.cmake
@@ -128,7 +128,12 @@
# Looking for AMD GPUs...
################################################################################
-find_program(LIBOMPTARGET_AMDGPU_ARCH NAMES amdgpu-arch PATHS ${LLVM_BINARY_DIR}/bin)
+if(TARGET amdgpu-arch)
+ set(LIBOMPTARGET_AMDGPU_ARCH $<TARGET_FILE:amdgpu-arch>)
+else()
+ find_program(LIBOMPTARGET_AMDGPU_ARCH NAMES amdgpu-arch PATHS ${LLVM_BINARY_DIR}/bin)
+endif()
+
if(LIBOMPTARGET_AMDGPU_ARCH)
execute_process(COMMAND ${LIBOMPTARGET_AMDGPU_ARCH}
OUTPUT_VARIABLE LIBOMPTARGET_AMDGPU_ARCH_OUTPUT
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D153628.533947.patch
Type: text/x-patch
Size: 850 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20230623/79ab6bf3/attachment.bin>
More information about the Openmp-commits
mailing list