# Planning change that might break LANG\_INCLUDE\_WHAT\_YOU\_USE

**URL:** https://discourse.cmake.org/t/planning-change-that-might-break-lang-include-what-you-use/4598
**Category:** Development
**Created:** [December 5, 2021, 12:13pm UTC](https://discourse.cmake.org/t/planning-change-that-might-break-lang-include-what-you-use/4598 "2021-12-05T12:13:56Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![kimgr](https://discourse.cmake.org/user_avatar/discourse.cmake.org/kimgr/32/2009_2.png) [@kimgr](https://discourse.cmake.org/u/kimgr)
#### Post date: [December 5, 2021, 12:13pm UTC](https://discourse.cmake.org/t/planning-change-that-might-break-lang-include-what-you-use/4598/1 "2021-12-05T12:13:56Z")

</div>

Hello,

I maintain the `include-what-you-use` project and was surprised and happy to see native CMake support for IWYU in version 3.3 – thanks!

We’re planning a change to abandon `include-what-you-use`'s unusual exit code policy. It currently always returns non-zero, originally to trick GNU Make into re-running it for every invocation. The plan is to make it more conventional (zero for success, non-zero for failure), and provide a command-line switch to force the Make-friendly behavior.

I wanted to double-check with you folks if that would break the CMake integration? If so:

- what can we do to avoid that?
- can we expose a good way for you to know if you’re running new or old IWYU?

Grateful for any thoughts on the matter.

Thanks,  
Kim

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.cmake.org/u/ben.boeckel)
#### Post date: [December 5, 2021, 1:50pm UTC](https://discourse.cmake.org/t/planning-change-that-might-break-lang-include-what-you-use/4598/2 "2021-12-05T13:50:26Z")

</div>

I think a clear version delineation would be sufficient. CMake could inject a configure dependency on the binary (in case it updates out-of-band) to ensure that it updates for any change over the version barrier.

Cc: @brad.king

---

<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: [December 6, 2021, 4:05pm UTC](https://discourse.cmake.org/t/planning-change-that-might-break-lang-include-what-you-use/4598/3 "2021-12-06T16:05:10Z")

</div>

CMake’s `include-what-you-use` integration already [ignores the exit code](https://gitlab.kitware.com/cmake/cmake/-/blob/v3.22.0/Source/cmcmd.cxx#L341-344). We run IWYU along with the compiler whenever the corresponding object file needs to be rebuilt. IWYU results are treated as incidental, just like compiler warnings. Therefore the planned change to `include-what-you-use` won’t affect CMake’s existing support at all.

---

<div class="post-metadata">

### Author: ![kimgr](https://discourse.cmake.org/user_avatar/discourse.cmake.org/kimgr/32/2009_2.png) [@kimgr](https://discourse.cmake.org/u/kimgr)
#### Post date: [December 6, 2021, 6:00pm UTC](https://discourse.cmake.org/t/planning-change-that-might-break-lang-include-what-you-use/4598/4 "2021-12-06T18:00:16Z")

</div>

I suspected that was the case, thanks for confirming!

Now to see if I can get that change rolling 🙂

Cheers,  
Kim
