Skip to content

sonar.cxx.forceIncludes

guwirth edited this page Jan 9, 2021 · 8 revisions

Force Include

The C++ community plugin provides 'force-including' of header files. 'Force-including' files is sometimes a useful method for defining macros, types or compiler-specific extensions.

This option has the same effect as specifying the file with double quotation marks in an #include directive on the first line of every source file When you add multiple files, they are included in the file to be compiled in the order in which they are listed, from left to right.

The search order for the header files is the same as the quoted include form. The order can be defined via sonar.cxx.includeDirectories.

See also

Example

sonar.cxx.forceIncludes=VS10Macros.h,MyMacros.h

Original source code file:

// Comment
#include "stdafx.h"
#include "..."
...
// your source code ...

Resulting source code file:

#include "VS10Macros.h"
#include "MyMacros.h"
// Comment
#include "stdafx.h"
...
#include "..."
// your source code ...
Clone this wiki locally