OrangesIWYU

Provides a function to set up the include-what-you-use static analysis tool.

Configure include-what-you-use

oranges_enable_iwyu
oranges_enable_iwyu (<target>
                    [EXTRA_ARGS <args...>]
                    [LANGS <C|CXX>...])

Configures include-what-you-use for the given <target> by manipulating the target’s <LANG>_INCLUDE_WHAT_YOU_USE properties.

If the IWYU_OFF variable is set to ON, this function does nothing.

Options:

EXTRA_ARGS

Extra arguments to pass to include-what-you-use verbatim. If not specified, the value of the IWYU_EXTRA_ARGS variable will be used.

LANGS

Languages for which to enable include-what-you-use. Valid values are C or CXX. If no languages are specified, this function will configure include-what-you-use for both valid languages.

Cache variables

IWYU_PROGRAM

Path to the include-what-you-use executable, used by oranges_enable_iwyu(). An environment variable with this name may also be set.

IWYU_EXTRA_ARGS

Space-separated arguments that will be passed verbatim to include-what-you-use in calls to oranges_enable_iwyu() that do not explicitly override this option. The environment variable with this name, if set, will initialize this variable; otherwise, defaults to --update_comments --cxx17ns.

IWYU_OFF

When this variable is set to ON, calls to oranges_enable_iwyu() do nothing. The environment variable with this name, if set, will initialize this variable; otherwise, defaults to OFF.

Environment variables

IWYU_PROGRAM

Initializes the value of the IWYU_PROGRAM variable.

IWYU_EXTRA_ARGS

Initializes the IWYU_EXTRA_ARGS variable.

IWYU_OFF

Initializes the IWYU_OFF variable.

See also

Module OrangesClangTidy

Module for clang-tidy

Module OrangesCppcheck

Module for cppcheck

Module OrangesCpplint

Module for cpplint

Module OrangesStaticAnalysis

Aggregate module for enabling all static analysis tools