[PATCH] D138258: clang/cmake: Fix incorrectly disabling tests when LLVM_EXTERNAL_LIT is used

Michał Górny via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 17 23:56:25 PST 2022


mgorny added inline comments.


================
Comment at: clang/CMakeLists.txt:97
     # Seek installed Lit.
-    find_program(LLVM_LIT
-                 NAMES llvm-lit lit.py lit
-                 PATHS "${LLVM_MAIN_SRC_DIR}/utils/lit"
-                 DOC "Path to lit.py")
+    if (NOT LLVM_EXTERNAL_LIT)
+      find_program(LLVM_EXTERNAL_LIT
----------------
I don't think you need to do this if you rename the var, `find_program()` doesn't seem to do any searching when the var is already set.

I've tested with a dummy CMakeLists:

```
set(FOO /bin/true)
find_program(FOO NAMES foo)
message(FATAL_ERROR ${FOO})
```

gives `/bin/true` for me.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138258/new/

https://reviews.llvm.org/D138258



More information about the cfe-commits mailing list