Add optional system include to compiler option builder

System includes suppress warnings and prevent indexing of unwanted symbols.
Using system includes for all includes outside of the project can be
quite advantageous. The rootProjectDirectory() can be extended to be set
in the project settings. An automatic generation could be possible but
could create an unwanted path which includes files outside of the
perceived project.

Change-Id: Ib9d3158f14f41efe1f6657f962d5c4437bb324b2
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
Marco Bubke
2018-08-14 13:07:04 +02:00
parent b592339b4d
commit 7bae47642c
8 changed files with 42 additions and 15 deletions

View File

@@ -74,7 +74,7 @@ void RefactoringEngine::startLocalRenaming(const CppTools::CursorInEditor &data,
QString filePath = data.filePath().toString();
QTextCursor textCursor = data.cursor();
CompilerOptionsBuilder optionsBuilder{*projectPart};
CompilerOptionsBuilder optionsBuilder{*projectPart, CppTools::UseSystemHeader::Yes};
Utils::SmallStringVector commandLine{optionsBuilder.build(
fileKindInProjectPart(projectPart, filePath),
CppTools::getPchUsage())};