forked from qt-creator/qt-creator
Use HostOsInfo::withExecutableSuffix instead of if/else
Let's use our Utils. Change-Id: I8cfbce55d2b41e42e86d050433df2cfd20cebe1b Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -215,9 +215,7 @@ bool AndroidBuildApkStep::init()
|
|||||||
QString command = version->hostBinPath().toString();
|
QString command = version->hostBinPath().toString();
|
||||||
if (!command.endsWith('/'))
|
if (!command.endsWith('/'))
|
||||||
command += '/';
|
command += '/';
|
||||||
command += "androiddeployqt";
|
command += Utils::HostOsInfo::withExecutableSuffix("androiddeployqt");
|
||||||
if (Utils::HostOsInfo::isWindowsHost())
|
|
||||||
command += ".exe";
|
|
||||||
|
|
||||||
QString outputDir = bc->buildDirectory().pathAppended(Constants::ANDROID_BUILDDIRECTORY).toString();
|
QString outputDir = bc->buildDirectory().pathAppended(Constants::ANDROID_BUILDDIRECTORY).toString();
|
||||||
|
|
||||||
|
@@ -589,10 +589,7 @@ void AndroidRunnerWorker::handleJdbWaiting()
|
|||||||
m_afterFinishAdbCommands.push_back(removeForward.join(' '));
|
m_afterFinishAdbCommands.push_back(removeForward.join(' '));
|
||||||
|
|
||||||
auto jdbPath = AndroidConfigurations::currentConfig().openJDKLocation().pathAppended("bin");
|
auto jdbPath = AndroidConfigurations::currentConfig().openJDKLocation().pathAppended("bin");
|
||||||
if (Utils::HostOsInfo::isWindowsHost())
|
jdbPath = jdbPath.pathAppended(Utils::HostOsInfo::withExecutableSuffix("jdb"));
|
||||||
jdbPath = jdbPath.pathAppended("jdb.exe");
|
|
||||||
else
|
|
||||||
jdbPath = jdbPath.pathAppended("jdb");
|
|
||||||
|
|
||||||
QStringList jdbArgs("-connect");
|
QStringList jdbArgs("-connect");
|
||||||
jdbArgs << QString("com.sun.jdi.SocketAttach:hostname=localhost,port=%1")
|
jdbArgs << QString("com.sun.jdi.SocketAttach:hostname=localhost,port=%1")
|
||||||
|
@@ -99,11 +99,8 @@ void GenerateResource::generateMenuEntry()
|
|||||||
temp.close();
|
temp.close();
|
||||||
|
|
||||||
auto rccBinary = QtSupport::QtKitAspect::qtVersion(currentProject->activeTarget()->kit())->hostBinPath();
|
auto rccBinary = QtSupport::QtKitAspect::qtVersion(currentProject->activeTarget()->kit())->hostBinPath();
|
||||||
#ifdef Q_OS_WIN
|
rccBinary = rccBinary.pathAppended(Utils::HostOsInfo::withExecutableSuffix("rcc"));
|
||||||
rccBinary = rccBinary.pathAppended("rcc.exe");
|
|
||||||
#else
|
|
||||||
rccBinary = rccBinary.pathAppended("rcc");
|
|
||||||
#endif
|
|
||||||
QProcess rccProcess;
|
QProcess rccProcess;
|
||||||
rccProcess.setProgram(rccBinary.toString());
|
rccProcess.setProgram(rccBinary.toString());
|
||||||
rccProcess.setWorkingDirectory(projectPath);
|
rccProcess.setWorkingDirectory(projectPath);
|
||||||
|
@@ -34,15 +34,6 @@
|
|||||||
|
|
||||||
namespace CplusplusToolsUtils {
|
namespace CplusplusToolsUtils {
|
||||||
|
|
||||||
QString portableExecutableName(const QString &executable)
|
|
||||||
{
|
|
||||||
#if defined(Q_OS_WIN)
|
|
||||||
return executable + QLatin1String(".exe");
|
|
||||||
#else
|
|
||||||
return executable;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
void executeCommand(const QString &command, const QStringList &arguments, const QString &outputFile,
|
void executeCommand(const QString &command, const QStringList &arguments, const QString &outputFile,
|
||||||
bool verbose)
|
bool verbose)
|
||||||
{
|
{
|
||||||
@@ -86,9 +77,9 @@ void executeCommand(const QString &command, const QStringList &arguments, const
|
|||||||
SystemPreprocessor::SystemPreprocessor(bool verbose)
|
SystemPreprocessor::SystemPreprocessor(bool verbose)
|
||||||
: m_verbose(verbose)
|
: m_verbose(verbose)
|
||||||
{
|
{
|
||||||
m_knownCompilers[portableExecutableName(QLatin1String("gcc"))]
|
m_knownCompilers[Utils::HostOsInfo::withExecutableSuffix("gcc")]
|
||||||
= QLatin1String("-DCPLUSPLUS_WITHOUT_QT -U__BLOCKS__ -xc++ -E -include");
|
= QLatin1String("-DCPLUSPLUS_WITHOUT_QT -U__BLOCKS__ -xc++ -E -include");
|
||||||
m_knownCompilers[portableExecutableName(QLatin1String("cl"))]
|
m_knownCompilers[Utils::HostOsInfo::withExecutableSuffix("cl")]
|
||||||
= QLatin1String("/DCPLUSPLUS_WITHOUT_QT /U__BLOCKS__ /TP /E /I . /FI");
|
= QLatin1String("/DCPLUSPLUS_WITHOUT_QT /U__BLOCKS__ /TP /E /I . /FI");
|
||||||
|
|
||||||
QMapIterator<QString, QString> i(m_knownCompilers);
|
QMapIterator<QString, QString> i(m_knownCompilers);
|
||||||
|
Reference in New Issue
Block a user