[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 13:50:06 PDT 2026


ferdymercury wrote:

> This `find_package()` is hit only if `CLANG_BUILT_STANDALONE` is set. `CLANG_BUILT_STANDALONE` is only set if building with clang as the top-level directory. How can LLVM be found then?

ROOT (software by CERN) compiles a patched version of Clang using

find_package(LLVM 22.1)
set(llvmlinkdylib false)
set(CLANG_BUILT_STANDALONE)
add subdirectory(clang)

Which searches again for LLVM and overrides llvm_link_dylib

So the best solution would be to bypass that double search if LLVM was alread

https://github.com/llvm/llvm-project/pull/218965


More information about the cfe-commits mailing list