[libclc] [libclc] use default paths with find_program when possible (PR #105969)

Harald van Dijk via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 23 04:37:34 PDT 2024


================
@@ -55,7 +55,7 @@ if( LIBCLC_STANDALONE_BUILD OR CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DI
   # Import required tools
   if( NOT EXISTS ${LIBCLC_CUSTOM_LLVM_TOOLS_BINARY_DIR} )
     foreach( tool IN ITEMS clang llvm-as llvm-link opt )
-      find_program( LLVM_TOOL_${tool} ${tool} PATHS ${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH )
+    find_program( LLVM_TOOL_${tool} ${tool} PATHS ${LLVM_TOOLS_BINARY_DIR} )
----------------
hvdijk wrote:

At https://github.com/RossComputerGuy/llvm-project/blob/056e0f9b7c7b788ad0d85a1479000fd1af4f98ce/libclc/CMakeLists.txt#L100-L104 there is a check for missing tools. This check would not work if using the imported targets if LLVM CMake files are installed, but the binaries are missing, which because of the way LLVM is split in distros is something that can easily happen.

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


More information about the cfe-commits mailing list