From dc74c69f016fa65949bf0cf691061e12bef93d29 Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Tue, 16 Apr 2024 16:53:18 +0100 Subject: [PATCH] [libclc] Provide a more helpful error when tools are missing --- libclc/CMakeLists.txt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libclc/CMakeLists.txt b/libclc/CMakeLists.txt index b0c29ed77270..5ce179524308 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 )