[llvm] Improve error message for cmake failure (PR #71404)

Jeremy Kun via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 6 07:14:48 PST 2023


https://github.com/j2kun created https://github.com/llvm/llvm-project/pull/71404

I ran into this error as a newbie, was educated [here](https://discord.com/channels/636084430946959380/642426447167881246/1171016269387018310). Updating the error message to be more descriptive about the problem and my options.

>From ab8b9710967be8c08612de0de7cffbdd2222b067 Mon Sep 17 00:00:00 2001
From: Jeremy Kun <jkun at google.com>
Date: Mon, 6 Nov 2023 07:04:30 -0800
Subject: [PATCH] improve error message for cmake failure

---
 llvm/cmake/modules/LLVMProcessSources.cmake | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/llvm/cmake/modules/LLVMProcessSources.cmake b/llvm/cmake/modules/LLVMProcessSources.cmake
index 340aa7b43eaed96..120af239b62b93d 100644
--- a/llvm/cmake/modules/LLVMProcessSources.cmake
+++ b/llvm/cmake/modules/LLVMProcessSources.cmake
@@ -113,7 +113,11 @@ function(llvm_check_source_file_list)
           else()
               set(fn_relative "${fn}")
           endif()
-          message(SEND_ERROR "Found unknown source file ${fn_relative}
+          message(SEND_ERROR "Found erroneous configuration for source file ${fn_relative}
+LLVM enforces that all source files are added to a build target, and that only\
+build target in a directory lists all files in that directory. \
+If you want multiple targets in the same directory, add \
+PARTIAL_SOURCES_INTENDED to the target specification, though it is discouraged.
 Please update ${CMAKE_CURRENT_LIST_FILE}\n")
         endif()
       endif()



More information about the llvm-commits mailing list