forked from qt-creator/qt-creator
Qmake: Move buildDir() from ProFileNode to QmakeBuildSystem
More a buildsystem than a node thing in general and removes one use of activeBuildSystem and one use of the ProFileNode -> ProFile back pointers. Change-Id: Ie007fcd0db9e9294a08b3a1cd68f825c7d3dc9b8 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -1336,7 +1336,7 @@ QmakeEvalInput QmakeProFile::evalInput() const
|
||||
QmakeEvalInput input;
|
||||
input.projectDir = directoryPath().toString();
|
||||
input.projectFilePath = filePath();
|
||||
input.buildDirectory = buildDir();
|
||||
input.buildDirectory = m_buildSystem->buildDir(m_filePath);
|
||||
input.sysroot = FilePath::fromString(m_buildSystem->qmakeSysroot());
|
||||
input.readerExact = m_readerExact;
|
||||
input.readerCumulative = m_readerCumulative;
|
||||
@@ -1726,7 +1726,7 @@ void QmakeProFile::applyEvaluate(QmakeEvalResult *evalResult)
|
||||
//
|
||||
// Add/Remove pri files, sub projects
|
||||
//
|
||||
FilePath buildDirectory = buildDir();
|
||||
FilePath buildDirectory = m_buildSystem->buildDir(m_filePath);
|
||||
makeEmpty();
|
||||
for (QmakePriFile * const toAdd : qAsConst(result->directChildren))
|
||||
addChild(toAdd);
|
||||
@@ -2069,20 +2069,6 @@ FilePath QmakeProFile::sourceDir() const
|
||||
return directoryPath();
|
||||
}
|
||||
|
||||
FilePath QmakeProFile::buildDir(BuildConfiguration *bc) const
|
||||
{
|
||||
if (!bc)
|
||||
bc = m_buildSystem->target()->activeBuildConfiguration();
|
||||
|
||||
const QDir srcDirRoot = QDir(m_buildSystem->projectDirectory().toString());
|
||||
const QString relativeDir = srcDirRoot.relativeFilePath(directoryPath().toString());
|
||||
const QString buildConfigBuildDir = bc ? bc->buildDirectory().toString() : QString();
|
||||
const QString buildDir = buildConfigBuildDir.isEmpty()
|
||||
? m_buildSystem->projectDirectory().toString()
|
||||
: buildConfigBuildDir;
|
||||
return FilePath::fromString(QDir::cleanPath(QDir(buildDir).absoluteFilePath(relativeDir)));
|
||||
}
|
||||
|
||||
FilePaths QmakeProFile::generatedFiles(const FilePath &buildDir,
|
||||
const FilePath &sourceFile,
|
||||
const FileType &sourceFileType) const
|
||||
|
||||
Reference in New Issue
Block a user