Skip to content

Commit 0e87f35

Browse files
committed
[cmake] Limit missing external lit warning to be shown once
When using a custom `LLVM_EXTERNAL_LIT`, it's possible the file may not exist at the CMake is generating the build. One example is LLDB standalone builds. When the external lit doesn't exist, a warning message is emitted, but the warning is printed once for every single lit target. This produces many redundant warnings. This changes the warning to only be emitted once, controlled by a CACHE variable. Other options are: 1. remove the warning 2. have callers pass an option to silence the warning if desired See https://reviews.llvm.org/D76945 for some context. Differential Revision: https://reviews.llvm.org/D89356 (cherry picked from commit 41f946a)
1 parent feab006 commit 0e87f35

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

llvm/cmake/modules/AddLLVM.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1669,8 +1669,9 @@ function(get_llvm_lit_path base_dir file_name)
16691669
set(${file_name} ${LIT_FILE_NAME} PARENT_SCOPE)
16701670
set(${base_dir} ${LIT_BASE_DIR} PARENT_SCOPE)
16711671
return()
1672-
else()
1672+
elseif (NOT DEFINED CACHE{LLVM_EXTERNAL_LIT_MISSING_WARNED_ONCE})
16731673
message(WARNING "LLVM_EXTERNAL_LIT set to ${LLVM_EXTERNAL_LIT}, but the path does not exist.")
1674+
set(LLVM_EXTERNAL_LIT_MISSING_WARNED_ONCE YES CACHE INTERNAL "")
16741675
endif()
16751676
endif()
16761677
endif()

0 commit comments

Comments
 (0)