[clang] [clang] prevent double package search if LLVM already found in parent directory (PR #218965)
via cfe-commits
cfe-commits at lists.llvm.org
Sun Aug 30 14:26:34 PDT 2026
================
@@ -45,7 +45,9 @@ if(CLANG_BUILT_STANDALONE)
mark_as_advanced(LLVM_ENABLE_ASSERTIONS)
endif()
- find_package(LLVM REQUIRED HINTS "${LLVM_CMAKE_DIR}")
+ if(NOT LLVM_FOUND)
----------------
zhangweize9-cyber wrote:
At the time, I was only thinking about the possibility that the `LLVM_DIR` variable might be contaminated by environmental factors.
Additionally, if you write two conditions at the same time, the former is a scope variable and the latter is a cached variable, which will cause the condition to return true directly.
https://github.com/llvm/llvm-project/pull/218965
More information about the cfe-commits
mailing list