summaryrefslogtreecommitdiffstats
path: root/qmake/generators
diff options
context:
space:
mode:
Diffstat (limited to 'qmake/generators')
-rw-r--r--qmake/generators/makefile.cpp16
-rw-r--r--qmake/generators/makefile.h2
-rw-r--r--qmake/generators/unix/unixmake2.cpp10
-rw-r--r--qmake/generators/win32/msvc_objectmodel.cpp5
-rw-r--r--qmake/generators/win32/msvc_vcproj.cpp40
5 files changed, 25 insertions, 48 deletions
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index 7e471f126c..8e46da521f 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -1851,7 +1851,6 @@ QString MakefileGenerator::resolveDependency(const QDir &outDir, const QString &
}
void MakefileGenerator::callExtraCompilerDependCommand(const ProString &extraCompiler,
- const QString &dep_cd_cmd,
const QString &tmp_dep_cmd,
const QString &inpf,
const QString &tmp_out,
@@ -1864,7 +1863,10 @@ void MakefileGenerator::callExtraCompilerDependCommand(const ProString &extraCom
QString dep_cmd = replaceExtraCompilerVariables(tmp_dep_cmd, inpf, tmp_out, LocalShell);
if (checkCommandAvailability && !canExecute(dep_cmd))
return;
- dep_cmd = dep_cd_cmd + fixEnvVariables(dep_cmd);
+ dep_cmd = QLatin1String("cd ")
+ + IoUtils::shellQuote(Option::fixPathToLocalOS(Option::output_dir, false))
+ + QLatin1String(" && ")
+ + fixEnvVariables(dep_cmd);
if (FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), QT_POPEN_READ)) {
QByteArray depData;
while (int read_in = feof(proc) ? 0 : (int)fread(buff, 1, 255, proc))
@@ -1916,12 +1918,6 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
FileFixifyFromOutdir);
const QString tmp_cmd = project->values(ProKey(*it + ".commands")).join(' ');
const QString tmp_dep_cmd = project->values(ProKey(*it + ".depend_command")).join(' ');
- QString dep_cd_cmd;
- if (!tmp_dep_cmd.isEmpty()) {
- dep_cd_cmd = QLatin1String("cd ")
- + IoUtils::shellQuote(Option::fixPathToLocalOS(Option::output_dir, false))
- + QLatin1String(" && ");
- }
const bool dep_lines = (config.indexOf("dep_lines") != -1);
const ProStringList &vars = project->values(ProKey(*it + ".variables"));
if(tmp_out.isEmpty() || tmp_cmd.isEmpty())
@@ -2035,7 +2031,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
deps += findDependencies(inpf);
inputs += Option::fixPathToTargetOS(inpf, false);
if(!tmp_dep_cmd.isEmpty() && doDepends()) {
- callExtraCompilerDependCommand(*it, dep_cd_cmd, tmp_dep_cmd, inpf,
+ callExtraCompilerDependCommand(*it, tmp_dep_cmd, inpf,
tmp_out, dep_lines, &deps, existingDepsOnly);
}
}
@@ -2084,7 +2080,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
for (ProStringList::ConstIterator it3 = vars.constBegin(); it3 != vars.constEnd(); ++it3)
cmd.replace("$(" + (*it3) + ")", "$(QMAKE_COMP_" + (*it3)+")");
if(!tmp_dep_cmd.isEmpty() && doDepends()) {
- callExtraCompilerDependCommand(*it, dep_cd_cmd, tmp_dep_cmd, inpf,
+ callExtraCompilerDependCommand(*it, tmp_dep_cmd, inpf,
tmp_out, dep_lines, &deps, existingDepsOnly);
//use the depend system to find includes of these included files
QStringList inc_deps;
diff --git a/qmake/generators/makefile.h b/qmake/generators/makefile.h
index ab970c966f..a96b9c54da 100644
--- a/qmake/generators/makefile.h
+++ b/qmake/generators/makefile.h
@@ -84,7 +84,7 @@ protected:
void writeExtraVariables(QTextStream &t);
void writeExtraTargets(QTextStream &t);
QString resolveDependency(const QDir &outDir, const QString &file);
- void callExtraCompilerDependCommand(const ProString &extraCompiler, const QString &dep_cd_cmd,
+ void callExtraCompilerDependCommand(const ProString &extraCompiler,
const QString &tmp_dep_cmd, const QString &inpf,
const QString &tmp_out, bool dep_lines, QStringList *deps,
bool existingDepsOnly,
diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp
index 550fa9d834..4a6a42c7d2 100644
--- a/qmake/generators/unix/unixmake2.cpp
+++ b/qmake/generators/unix/unixmake2.cpp
@@ -1542,14 +1542,14 @@ std::pair<bool, QString> UnixMakefileGenerator::writeObjectsPart(QTextStream &t,
t << "\\\n\t\t" << (*objit);
}
if (incrs_out.count() == objs.count()) { //we just switched places, no real incrementals to be done!
- t << escapeFilePaths(incrs_out).join(QString(" \\\n\t\t")) << endl;
+ t << escapeFilePaths(incrs_out).join(QString(" \\\n\t\t")) << Qt::endl;
} else if (!incrs_out.count()) {
- t << endl;
+ t << Qt::endl;
} else {
src_incremental = true;
- t << endl;
+ t << Qt::endl;
t << "INCREMENTAL_OBJECTS = "
- << escapeFilePaths(incrs_out).join(QString(" \\\n\t\t")) << endl;
+ << escapeFilePaths(incrs_out).join(QString(" \\\n\t\t")) << Qt::endl;
}
} else {
const ProString &objMax = project->first("QMAKE_LINK_OBJECT_MAX");
@@ -1566,7 +1566,7 @@ std::pair<bool, QString> UnixMakefileGenerator::writeObjectsPart(QTextStream &t,
createResponseFile(ld_response_file, objs);
objectsLinkLine = "@" + escapeFilePath(ld_response_file);
}
- t << "OBJECTS = " << valList(escapeDependencyPaths(objs)) << endl;
+ t << "OBJECTS = " << valList(escapeDependencyPaths(objs)) << Qt::endl;
}
return std::make_pair(src_incremental, objectsLinkLine);
}
diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp
index 2b39a4baaa..3002ce889c 100644
--- a/qmake/generators/win32/msvc_objectmodel.cpp
+++ b/qmake/generators/win32/msvc_objectmodel.cpp
@@ -2351,10 +2351,7 @@ bool VCFilter::addExtraCompiler(const VCFilterFile &info)
if (!tmp_dep.isEmpty())
deps = tmp_dep;
if (!tmp_dep_cmd.isEmpty()) {
- const QString dep_cd_cmd = QLatin1String("cd ")
- + IoUtils::shellQuote(Option::fixPathToLocalOS(Option::output_dir, false))
- + QLatin1String(" && ");
- Project->callExtraCompilerDependCommand(extraCompilerName, dep_cd_cmd, tmp_dep_cmd,
+ Project->callExtraCompilerDependCommand(extraCompilerName, tmp_dep_cmd,
inFile, out,
true, // dep_lines
&deps,
diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp
index 867b14faea..e117f472e0 100644
--- a/qmake/generators/win32/msvc_vcproj.cpp
+++ b/qmake/generators/win32/msvc_vcproj.cpp
@@ -1481,36 +1481,20 @@ void VcprojGenerator::initResourceFiles()
// Bad hack, please look away -------------------------------------
QString rcc_dep_cmd = project->values("rcc.depend_command").join(' ');
if(!rcc_dep_cmd.isEmpty()) {
- ProStringList qrc_files = project->values("RESOURCES");
+ const QStringList qrc_files = project->values("RESOURCES").toQStringList();
QStringList deps;
- if(!qrc_files.isEmpty()) {
- for (int i = 0; i < qrc_files.count(); ++i) {
- char buff[256];
- QString dep_cmd = replaceExtraCompilerVariables(
- rcc_dep_cmd, qrc_files.at(i).toQString(), QString(), LocalShell);
-
- dep_cmd = Option::fixPathToLocalOS(dep_cmd, true, false);
- if(canExecute(dep_cmd)) {
- dep_cmd.prepend(QLatin1String("cd ")
- + IoUtils::shellQuote(Option::fixPathToLocalOS(Option::output_dir, false))
- + QLatin1String(" && "));
- if (FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), QT_POPEN_READ)) {
- QString indeps;
- while(!feof(proc)) {
- int read_in = (int)fread(buff, 1, 255, proc);
- if(!read_in)
- break;
- indeps += QByteArray(buff, read_in);
- }
- QT_PCLOSE(proc);
- if(!indeps.isEmpty())
- deps += fileFixify(indeps.replace('\n', ' ').simplified().split(' '),
- FileFixifyFromOutdir);
- }
- }
- }
- vcProject.ResourceFiles.addFiles(deps);
+ for (const QString &qrc_file : qrc_files) {
+ callExtraCompilerDependCommand("rcc",
+ rcc_dep_cmd,
+ qrc_file,
+ QString(),
+ true, // dep_lines
+ &deps,
+ false, // existingDepsOnly
+ true // checkCommandavailability
+ );
}
+ vcProject.ResourceFiles.addFiles(deps);
}
// You may look again --------------------------------------------