[libclc] dc74c69 - [libclc] Provide a more helpful error when tools are missing

Fraser Cormack via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 17 23:01:38 PDT 2024


Author: Fraser Cormack
Date: 2024-04-18T07:01:13+01:00
New Revision: dc74c69f016fa65949bf0cf691061e12bef93d29

URL: https://github.com/llvm/llvm-project/commit/dc74c69f016fa65949bf0cf691061e12bef93d29
DIFF: https://github.com/llvm/llvm-project/commit/dc74c69f016fa65949bf0cf691061e12bef93d29.diff

LOG: [libclc] Provide a more helpful error when tools are missing

Added: 
    

Modified: 
    libclc/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/libclc/CMakeLists.txt b/libclc/CMakeLists.txt
index b0c29ed77270cf..5ce17952430854 100644
--- a/libclc/CMakeLists.txt
+++ b/libclc/CMakeLists.txt
@@ -94,10 +94,11 @@ if( EXISTS ${LIBCLC_CUSTOM_LLVM_TOOLS_BINARY_DIR} )
   endforeach()
 endif()
 
-if( NOT TARGET libclc::clang OR NOT TARGET libclc::opt
-    OR NOT TARGET libclc::llvm-as OR NOT TARGET libclc::llvm-link )
-  message( FATAL_ERROR "libclc toolchain incomplete!" )
-endif()
+foreach( tool IN ITEMS clang opt llvm-as llvm-link )
+  if( NOT TARGET libclc::${tool} )
+    message( FATAL_ERROR "libclc toolchain incomplete - missing tool ${tool}!" )
+  endif()
+endforeach()
 
 # llvm-spirv is an optional dependency, used to build spirv-* targets.
 find_program( LLVM_SPIRV llvm-spirv PATHS ${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH )


        


More information about the cfe-commits mailing list