Qmake: Make executableFor() return a FilePath instead of QString

Change-Id: Ie7e0432080577aedb9c8a4be2d20388afbdce349
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
hjk
2021-06-17 12:21:23 +02:00
parent f66df921d7
commit 3721f60934
2 changed files with 8 additions and 8 deletions

View File

@@ -1159,7 +1159,7 @@ void QmakeBuildSystem::updateBuildSystemData()
workingDir += '/' + ti.target + ".app/Contents/MacOS";
BuildTargetInfo bti;
bti.targetFilePath = FilePath::fromString(executableFor(node->proFile()));
bti.targetFilePath = executableFor(node->proFile());
bti.projectFilePath = node->filePath();
bti.workingDirectory = FilePath::fromString(workingDir);
bti.displayName = bti.projectFilePath.completeBaseName();
@@ -1249,9 +1249,9 @@ void QmakeBuildSystem::collectData(const QmakeProFile *file, DeploymentData &dep
void QmakeBuildSystem::collectApplicationData(const QmakeProFile *file, DeploymentData &deploymentData)
{
QString executable = executableFor(file);
const FilePath executable = executableFor(file);
if (!executable.isEmpty())
deploymentData.addFile(executable, file->installsList().targetPath,
deploymentData.addFile(executable.path(), file->installsList().targetPath,
DeployableFile::TypeExecutable);
}
@@ -1413,16 +1413,16 @@ void QmakeBuildSystem::warnOnToolChainMismatch(const QmakeProFile *pro) const
getFullPathOf(pro, Variable::QmakeCxx, bc));
}
QString QmakeBuildSystem::executableFor(const QmakeProFile *file)
FilePath QmakeBuildSystem::executableFor(const QmakeProFile *file)
{
const ToolChain *const tc = ToolChainKitAspect::cxxToolChain(kit());
if (!tc)
return QString();
return {};
TargetInformation ti = file->targetInformation();
QString target;
QTC_ASSERT(file, return QString());
QTC_ASSERT(file, return {});
if (tc->targetAbi().os() == Abi::DarwinOS
&& file->variableValue(Variable::Config).contains("app_bundle")) {
@@ -1434,7 +1434,7 @@ QString QmakeBuildSystem::executableFor(const QmakeProFile *file)
else
target = ti.target + extension;
}
return QDir(destDirFor(ti).toString()).absoluteFilePath(target);
return (destDirFor(ti) / target).absoluteFilePath();
}
ProjectImporter *QmakeProject::projectImporter() const

View File

@@ -114,7 +114,7 @@ public:
void buildFinished(bool success);
void activeTargetWasChanged(ProjectExplorer::Target *);
QString executableFor(const QmakeProFile *file);
Utils::FilePath executableFor(const QmakeProFile *file);
void updateCppCodeModel();
void updateQmlJSCodeModel();