# CMAKE\_VERIFY\_INTERFACE\_HEADER\_SETS should prevent clang-tidy warnings too?

**URL:** https://discourse.cmake.org/t/cmake-verify-interface-header-sets-should-prevent-clang-tidy-warnings-too/10565
**Category:** Development
**Created:** [April 4, 2024, 12:56pm UTC](https://discourse.cmake.org/t/cmake-verify-interface-header-sets-should-prevent-clang-tidy-warnings-too/10565 "2024-04-04T12:56:04Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![ClausKlein](https://discourse.cmake.org/user_avatar/discourse.cmake.org/clausklein/32/352_2.png) [@ClausKlein](https://discourse.cmake.org/u/ClausKlein)
#### Post date: [April 4, 2024, 12:56pm UTC](https://discourse.cmake.org/t/cmake-verify-interface-header-sets-should-prevent-clang-tidy-warnings-too/10565/1 "2024-04-04T12:56:05Z")

</div>

With `clang-tidy-17` there are new checks that should suppressed **IMHO** :

```cpp
// NOLINTNEXTLINE(misc-header-include-cycle,misc-include-cleaner)
#include <asio/executor.hpp> // IWYU pragma: associated

```

---

<div class="post-metadata">

### Author: ![brad.king](https://discourse.cmake.org/user_avatar/discourse.cmake.org/brad.king/32/11_2.png) [@brad.king](https://discourse.cmake.org/u/brad.king)
#### Post date: [April 4, 2024, 1:09pm UTC](https://discourse.cmake.org/t/cmake-verify-interface-header-sets-should-prevent-clang-tidy-warnings-too/10565/2 "2024-04-04T13:09:17Z")

</div>

For reference, those checks:

- [misc-header-include-cycle](https://clang.llvm.org/extra/clang-tidy/checks/misc/header-include-cycle.html)
- [misc-include-cleaner](https://clang.llvm.org/extra/clang-tidy/checks/misc/include-cleaner.html)

look like clang-tidy’s version of `include-what-you-use`.

Yes, I think the proposal makes sense. I’d welcome a merge request adding that. See [CMake MR 7762](https://gitlab.kitware.com/cmake/cmake/-/merge_requests/7762) for the addition of `// IWYU pragma: associated` as an example.

---

<div class="post-metadata">

### Author: ![ClausKlein](https://discourse.cmake.org/user_avatar/discourse.cmake.org/clausklein/32/352_2.png) [@ClausKlein](https://discourse.cmake.org/u/ClausKlein)
#### Post date: [April 4, 2024, 2:42pm UTC](https://discourse.cmake.org/t/cmake-verify-interface-header-sets-should-prevent-clang-tidy-warnings-too/10565/3 "2024-04-04T14:42:58Z")

</div>

The same problem exist for `CMAKE_UNITY_BUILD` too

```cpp
==> build/standalone/_deps/myproject-build/CMakeFiles/myproject.dir/Unity/unity_0_cxx.cxx <==
/* generated by CMake */

/* NOLINTNEXTLINE(bugprone-suspicious-include,misc-include-cleaner) */
#include "/home/klein_cl/Workspace/cpp/myproject/src/ConnectionManager.cpp"

```

---

<div class="post-metadata">

### Author: ![ClausKlein](https://discourse.cmake.org/user_avatar/discourse.cmake.org/clausklein/32/352_2.png) [@ClausKlein](https://discourse.cmake.org/u/ClausKlein)
#### Post date: [April 4, 2024, 8:07pm UTC](https://discourse.cmake.org/t/cmake-verify-interface-header-sets-should-prevent-clang-tidy-warnings-too/10565/4 "2024-04-04T20:07:49Z")

</div>

> [@brad.king](#):
>
> I’d welcome a merge request adding that

see [https://gitlab.kitware.com/cmake/cmake/-/merge\_requests/9404](https://gitlab.kitware.com/cmake/cmake/-/merge_requests/9404)
