Comment #1 on issue 975 by kimgr: Confusion about path/to/iwyu; Clang 11 and Clang 13 failed to use
https://github.com/include-what-you-use/include-what-you-use/issues/975
`/path/to/iwyu` and `-Xiwyu;any;-Xiwyu;args` are both brief placeholders, I think they assume you know what the `include-what-you-use` command line looks like.
> I don't know what exactly path/to/iwyu mean, is that the absolute path of the executable iwyu ?
> I build include-what-you-use from source, the executable I get is include-what-you-use instead of iwyu
Yes, make it the absolute path to the `include-what-you-use` executable.
> I don't know what exactly does -Xiwyu;any;-Xiwyu;iwyu;-Xiwyu;args mean, should I change them, or keep them anyway?
IWYU's command-line is a little strange. It accepts all compiler arguments just like the `clang` compiler, so for example `-I/usr/include/somelib` and `-DFOO=BAR` are accepted and passed directly onto the Clang front-end for parsing.
Any IWYU arguments need to be prefixed with `-Xiwyu`, e.g. `-Xiwyu --verbose=4` or `-Xiwyu --no_comments`.
What the example is trying to say is that you need to put any additional arguments as a semicolon-separated list, and if they are IWYU-specific arguments, they need to be `-Xiwyu`-prefixed.
So if your direct `include-what-you-use` command was `/code/build/bin/include-what-you-use -Xiwyu --verbose=7 -Xiwyu --cxx17ns ...build args... mysourcefile.cc`, the CMake command would be:
```
cmake -DCMAKE_CXX_INCLUDE_WHAT_YOU_USE="/code/build/bin/include-what-you-use;-Xiwyu;--verbose=7;-Xiwyu;--cxx17ns"`
```
(note that `...build args...` in the first example is a place holder for any compiler flags normally provided by the build system. They are provided by CMake automatically, so you only need to add any custom IWYU args)