Planning change that might break LANG_INCLUDE_WHAT_YOU_USE


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.


1 Like

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

CMake’s include-what-you-use integration already ignores the exit code. 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.

I suspected that was the case, thanks for confirming!

Now to see if I can get that change rolling :slight_smile: