[clang] [Clang] Don't build static analyzer if disabled (PR #212024)
Alexis Engelke via cfe-commits
cfe-commits at lists.llvm.org
Wed Jul 29 11:50:10 PDT 2026
aengelke wrote:
> Could we revert this while talking about a path forward?
Sure, reverted.
> Why is it painful? Just building clang doesn't build it, does it?
It does and costs time. As _all_ clang libraries get linked into libclang-cpp.so, also libraries that the clang binary does not need (clangStaticAnalyzer*, clangTooling\*, clangAnalysisFlowSensitiveModels, clangDynamicASTMatchers, clangIndex, clang-fuzzer/handle-\*, clangFormat, clangDirectoryWatcher, ...) need to get built even when all I want is the clang binary (`ninja clang`). 1/3 of the extra compile time caused these "dylib-only" libraries is clangStaticAnalyzer (causing a build time increase of ~10%).
Not sure what the best path here is. Clang doesn't seem to have a "exclude from dylib" mechanism in place and we can't use the clang-tidy variable in the clang CMakeLists.txt.
https://github.com/llvm/llvm-project/pull/212024
More information about the cfe-commits
mailing list