From 3abaf647d0c632a4dfcb00d9ad2d1ffe66e014d9 Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Mon, 3 Sep 2018 16:10:43 +0200 Subject: Add system include path to HeaderPath and merge ProjectPartHeaderPath System include paths are appended after other includes by the compiler. So we should set them as system includes and not as normal includes. Otherwise we change the include order. Headers in system include paths are not cluttering the screen with unwanted warning and by the way improve performance too. ProjectPartHeaderPath was a dopperganger of HeaderPath, so we merged them. Change-Id: I7c394b4098b697de79761499ffcd5913cc02d652 Reviewed-by: Tobias Hunger --- src/plugins/cpptools/cppsourceprocessor_test.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/plugins/cpptools/cppsourceprocessor_test.cpp') diff --git a/src/plugins/cpptools/cppsourceprocessor_test.cpp b/src/plugins/cpptools/cppsourceprocessor_test.cpp index 9f1daa7ffc..357975fabd 100644 --- a/src/plugins/cpptools/cppsourceprocessor_test.cpp +++ b/src/plugins/cpptools/cppsourceprocessor_test.cpp @@ -47,6 +47,7 @@ using namespace CPlusPlus; using namespace CppTools; using namespace CppTools::Tests; using namespace CppTools::Internal; +using ProjectExplorer::IncludePathType; typedef Document::Include Include; @@ -63,9 +64,9 @@ public: { QScopedPointer sourceProcessor( CppModelManager::createSourceProcessor()); - const ProjectPartHeaderPath hp(TestIncludePaths::directoryOfTestFile(), - ProjectPartHeaderPath::IncludePath); - sourceProcessor->setHeaderPaths(ProjectPartHeaderPaths() << hp); + const ProjectExplorer::HeaderPath hp(TestIncludePaths::directoryOfTestFile(), + IncludePathType::User); + sourceProcessor->setHeaderPaths({hp}); sourceProcessor->run(filePath); Document::Ptr document = m_cmm->document(filePath); @@ -207,9 +208,8 @@ void CppToolsPlugin::test_cppsourceprocessor_includeNext() CppSourceProcessor::DocumentCallback documentCallback = [](const Document::Ptr &){}; CppSourceProcessor sourceProcessor(Snapshot(), documentCallback); - ProjectPartHeaderPaths headerPaths = ProjectPartHeaderPaths() - << ProjectPartHeaderPath(customHeaderPath, ProjectPartHeaderPath::IncludePath) - << ProjectPartHeaderPath(systemHeaderPath, ProjectPartHeaderPath::IncludePath); + ProjectExplorer::HeaderPaths headerPaths = {{customHeaderPath, IncludePathType::User}, + {systemHeaderPath, IncludePathType::User}}; sourceProcessor.setHeaderPaths(headerPaths); sourceProcessor.run(mainFilePath); -- cgit v1.2.1