When using a custom LLVM_EXTERNAL_LIT, it's possible the file may not exist at the time 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 lit target. This produces many redundant warnings.
This changes the warning to only be emitted once, controlled by a CACHE variable.
Other options are:
- remove the warning
- have callers pass an option to silence the warning if desired
See https://reviews.llvm.org/D76945 for some context.