Merge remote-tracking branch 'origin/4.7'

Change-Id: I762dbddb0f337e9a5fc4b113c7876813e9f45c9c
This commit is contained in:
Eike Ziller
2018-06-11 16:01:18 +02:00
62 changed files with 519 additions and 399 deletions

View File

@@ -26,6 +26,7 @@
#include "compileroptionsbuilder.h"
#include <coreplugin/icore.h>
#include <coreplugin/vcsmanager.h>
#include <projectexplorer/project.h>
#include <projectexplorer/projectexplorerconstants.h>
@@ -137,7 +138,12 @@ static Utils::FileName projectTopLevelDirectory(const ProjectPart &projectPart)
{
if (!projectPart.project)
return Utils::FileName();
return projectPart.project->projectDirectory();
const Utils::FileName result = projectPart.project->projectDirectory();
const Utils::FileName vcsTopLevel = Utils::FileName::fromString(
Core::VcsManager::findTopLevelForDirectory(result.toString()));
if (result.isChildOf(vcsTopLevel))
return vcsTopLevel;
return result;
}
void CompilerOptionsBuilder::addHeaderPathOptions()
@@ -165,10 +171,13 @@ void CompilerOptionsBuilder::addHeaderPathOptions()
// intentional fall-through:
case HeaderPath::IncludePath:
path = absoluteDirectory(headerPath.path);
if (path == projectDirectory || path.isChildOf(projectDirectory))
if (projectDirectory.isEmpty()
|| path == projectDirectory
|| path.isChildOf(projectDirectory)) {
prefix = defaultPrefix;
else
} else {
prefix = SYSTEM_INCLUDE_PREFIX;
}
break;
}