forked from qt-creator/qt-creator
Qmake: FilePathify remaining qmakeproject.cpp
Change-Id: I79860efc69b0053701306a83c61dfc4bc2d31bb3 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -1140,30 +1140,30 @@ void QmakeBuildSystem::updateBuildSystemData()
|
|||||||
|
|
||||||
const QStringList &config = node->variableValue(Variable::Config);
|
const QStringList &config = node->variableValue(Variable::Config);
|
||||||
|
|
||||||
QString destDir = ti.destDir.toString();
|
FilePath destDir = ti.destDir;
|
||||||
QString workingDir;
|
FilePath workingDir;
|
||||||
if (!destDir.isEmpty()) {
|
if (!destDir.isEmpty()) {
|
||||||
bool workingDirIsBaseDir = false;
|
bool workingDirIsBaseDir = false;
|
||||||
if (destDir == ti.buildTarget)
|
if (destDir.path() == ti.buildTarget)
|
||||||
workingDirIsBaseDir = true;
|
workingDirIsBaseDir = true;
|
||||||
if (QDir::isRelativePath(destDir))
|
if (QDir::isRelativePath(destDir.path()))
|
||||||
destDir = QDir::cleanPath(ti.buildDir.toString() + '/' + destDir);
|
destDir = ti.buildDir / destDir.path();
|
||||||
|
|
||||||
if (workingDirIsBaseDir)
|
if (workingDirIsBaseDir)
|
||||||
workingDir = ti.buildDir.toString();
|
workingDir = ti.buildDir;
|
||||||
else
|
else
|
||||||
workingDir = destDir;
|
workingDir = destDir;
|
||||||
} else {
|
} else {
|
||||||
workingDir = ti.buildDir.toString();
|
workingDir = ti.buildDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (HostOsInfo::isMacHost() && config.contains("app_bundle"))
|
if (HostOsInfo::isMacHost() && config.contains("app_bundle"))
|
||||||
workingDir += '/' + ti.target + ".app/Contents/MacOS";
|
workingDir = workingDir / (ti.target + ".app/Contents/MacOS");
|
||||||
|
|
||||||
BuildTargetInfo bti;
|
BuildTargetInfo bti;
|
||||||
bti.targetFilePath = executableFor(node->proFile());
|
bti.targetFilePath = executableFor(node->proFile());
|
||||||
bti.projectFilePath = node->filePath();
|
bti.projectFilePath = node->filePath();
|
||||||
bti.workingDirectory = FilePath::fromString(workingDir);
|
bti.workingDirectory = workingDir;
|
||||||
bti.displayName = bti.projectFilePath.completeBaseName();
|
bti.displayName = bti.projectFilePath.completeBaseName();
|
||||||
const FilePath relativePathInProject
|
const FilePath relativePathInProject
|
||||||
= bti.projectFilePath.relativeChildPath(projectDirectory());
|
= bti.projectFilePath.relativeChildPath(projectDirectory());
|
||||||
@@ -1189,7 +1189,7 @@ void QmakeBuildSystem::updateBuildSystemData()
|
|||||||
QmakeProFile *proFile = node->proFile();
|
QmakeProFile *proFile = node->proFile();
|
||||||
QTC_ASSERT(proFile, return);
|
QTC_ASSERT(proFile, return);
|
||||||
const QString proDirectory = buildDir(proFile->filePath()).toString();
|
const QString proDirectory = buildDir(proFile->filePath()).toString();
|
||||||
foreach (QString dir, libDirectories) {
|
for (QString dir : libDirectories) {
|
||||||
// Fix up relative entries like "LIBS+=-L.."
|
// Fix up relative entries like "LIBS+=-L.."
|
||||||
const QFileInfo fi(dir);
|
const QFileInfo fi(dir);
|
||||||
if (!fi.isAbsolute())
|
if (!fi.isAbsolute())
|
||||||
@@ -1261,8 +1261,8 @@ static FilePath destDirFor(const TargetInformation &ti)
|
|||||||
{
|
{
|
||||||
if (ti.destDir.isEmpty())
|
if (ti.destDir.isEmpty())
|
||||||
return ti.buildDir;
|
return ti.buildDir;
|
||||||
if (QDir::isRelativePath(ti.destDir.toString()))
|
if (QDir::isRelativePath(ti.destDir.path()))
|
||||||
return FilePath::fromString(QDir::cleanPath(ti.buildDir.toString() + '/' + ti.destDir.toString()));
|
return ti.buildDir / ti.destDir.path();
|
||||||
return ti.destDir;
|
return ti.destDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1390,8 +1390,8 @@ void QmakeBuildSystem::testToolChain(ToolChain *tc, const FilePath &path) const
|
|||||||
// Suppress warnings on Apple machines where compilers in /usr/bin point into Xcode.
|
// Suppress warnings on Apple machines where compilers in /usr/bin point into Xcode.
|
||||||
// This will suppress some valid warnings, but avoids annoying Apple users with
|
// This will suppress some valid warnings, but avoids annoying Apple users with
|
||||||
// spurious warnings all the time!
|
// spurious warnings all the time!
|
||||||
if (pair.first.toString().startsWith("/usr/bin/")
|
if (pair.first.path().startsWith("/usr/bin/")
|
||||||
&& pair.second.toString().contains("/Contents/Developer/Toolchains/")) {
|
&& pair.second.path().contains("/Contents/Developer/Toolchains/")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
TaskHub::addTask(
|
TaskHub::addTask(
|
||||||
|
Reference in New Issue
Block a user