[clang-tools-extra] [clang-tools-extra] Add separate CLANG_TOOLS_EXTRA_INCLUDE_TESTS option for tests (PR #215761)
Deepesh Varatharajan via cfe-commits
cfe-commits at lists.llvm.org
Thu Aug 13 23:36:49 PDT 2026
DeepeshWR wrote:
> Might there be users who build with `CLANG_INCLUDE_TESTS=OFF` who were relying on it also disabling clang-tools-extra tests?
Hi @HighCommander4,
You were right about the backward-compatibility concern. With the current implementation, CLANG_TOOLS_EXTRA_INCLUDE_TESTS defaults to ON, so a configuration with CLANG_INCLUDE_TESTS=OFF could still have CLANG_TOOLS_EXTRA_INCLUDE_TESTS=ON.
I’m changing the implementation so that CLANG_TOOLS_EXTRA_INCLUDE_TESTS acts as an additional gate rather than an independent switch. The clang-tools-extra tests will now be generated only when both CLANG_INCLUDE_TESTS and CLANG_TOOLS_EXTRA_INCLUDE_TESTS are ON:
`if(CLANG_INCLUDE_TESTS AND CLANG_TOOLS_EXTRA_INCLUDE_TESTS)`
This preserves the existing behavior when CLANG_INCLUDE_TESTS=OFF, while still allowing the new use case of:
```
CLANG_INCLUDE_TESTS=ON
CLANG_TOOLS_EXTRA_INCLUDE_TESTS=OFF
```
to disable clang-tools-extra tests independently. I’ll update the patch.
https://github.com/llvm/llvm-project/pull/215761
More information about the cfe-commits
mailing list