[PATCH] D89356: [cmake] Limit missing external lit warning to be shown once
Dave Lee via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 13 18:29:57 PDT 2020
kastiglione created this revision.
kastiglione added reviewers: JDevlieghere, aprantl.
Herald added subscribers: llvm-commits, mgorny.
Herald added a project: LLVM.
kastiglione requested review of this revision.
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.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D89356
Files:
llvm/cmake/modules/AddLLVM.cmake
Index: llvm/cmake/modules/AddLLVM.cmake
===================================================================
--- llvm/cmake/modules/AddLLVM.cmake
+++ llvm/cmake/modules/AddLLVM.cmake
@@ -1659,7 +1659,10 @@
set(${base_dir} ${LIT_BASE_DIR} PARENT_SCOPE)
return()
else()
- message(WARNING "LLVM_EXTERNAL_LIT set to ${LLVM_EXTERNAL_LIT}, but the path does not exist.")
+ if (NOT DEFINED CACHE{LLVM_EXTERNAL_LIT_MISSING_WARNED_ONCE})
+ message(WARNING "LLVM_EXTERNAL_LIT set to ${LLVM_EXTERNAL_LIT}, but the path does not exist.")
+ set(LLVM_EXTERNAL_LIT_MISSING_WARNED_ONCE YES CACHE BOOL "")
+ endif()
endif()
endif()
endif()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D89356.298004.patch
Type: text/x-patch
Size: 701 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201014/a09273f2/attachment.bin>
More information about the llvm-commits
mailing list