[clang] Reapply "[cmake] Refactor clang unittest cmake" (PR #134195)
Reid Kleckner via cfe-commits
cfe-commits at lists.llvm.org
Mon Jun 30 13:20:12 PDT 2025
rnk wrote:
> Do I understand correctly that, as a result of this commit, the SemaTests target no longer exists, and to work on / run the tests that it used to include (such as HeuristicResolverTest.cpp), I have to build the ClangdUnitTests target, which requires building 1000+ test source files that I otherwise wouldn't need?
Yes and no: You need to build most clang code and most clang unittests, but clangd is its own subproject, and wasn't affected by this change.
I think the main change that would explain an increase in compile actions is that AllClangUnitTests includes clangCodeGen, which depends on LLVM, so if you want to run one Sema test, previously you would not need to build LLVM, but now you do.
However, this will soon be the case anyway, when `LLVM_LINK_LLVM_DYLIB` and `CLANG_LINK_CLANG_DYLIB` get enabled in #138187 ([RFC](https://discourse.llvm.org/t/rfc-llvm-link-llvm-dylib-should-default-to-on-on-posix-platforms/85908/1)).
This may negatively impact cold builds or builds-after-syncing due to the coarser-grained dependencies, but incremental builds should be nearly as fast. Are you observing something else, and if so, what CMake generator are you using?
https://github.com/llvm/llvm-project/pull/134195
More information about the cfe-commits
mailing list