summaryrefslogtreecommitdiffstats
path: root/qmake/generators
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@digia.com>2009-08-18 12:44:36 (GMT)
committerMiikka Heikkinen <miikka.heikkinen@digia.com>2009-08-18 12:44:36 (GMT)
commitfc58a8bd3c77b83d316a45ddcfd3edba93a4c1e4 (patch)
tree75ebe5ee35305cacff7b76a9c8ba606f803c85c3 /qmake/generators
parent06524f769fec76fa7ebcc39ac88ac9e08c720677 (diff)
downloadQt-fc58a8bd3c77b83d316a45ddcfd3edba93a4c1e4.zip
Qt-fc58a8bd3c77b83d316a45ddcfd3edba93a4c1e4.tar.gz
Qt-fc58a8bd3c77b83d316a45ddcfd3edba93a4c1e4.tar.bz2
Review fixes to qmake
- Removed MWC specific code and makefile - Added INTERNAL to few qmake variables that were only used internally Reviewed-by: Janne Koskinen
Diffstat (limited to 'qmake/generators')
-rw-r--r--qmake/generators/makefile.cpp44
-rw-r--r--qmake/generators/makefile.h5
-rw-r--r--qmake/generators/metamakefile.cpp3
-rw-r--r--qmake/generators/symbian/symmake_sbsv2.cpp6
-rw-r--r--qmake/generators/win32/msvc_dsp.cpp15
-rw-r--r--qmake/generators/win32/msvc_objectmodel.cpp23
-rw-r--r--qmake/generators/win32/msvc_vcproj.cpp19
7 files changed, 17 insertions, 98 deletions
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index 7241678..5d9178e 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -1705,9 +1705,9 @@ MakefileGenerator::writeExtraTargets(QTextStream &t)
t << "\n\t" << cmd;
t << endl << endl;
- project->values(QLatin1String("QMAKE_ET_PARSED_TARGETS.") + (*it)) << escapeDependencyPath(targ);
- project->values(QLatin1String("QMAKE_ET_PARSED_DEPS.") + (*it) + escapeDependencyPath(targ)) << deps.split(" ", QString::SkipEmptyParts);
- project->values(QLatin1String("QMAKE_ET_PARSED_CMD.") + (*it) + escapeDependencyPath(targ)) << cmd;
+ project->values(QLatin1String("QMAKE_INTERNAL_ET_PARSED_TARGETS.") + (*it)) << escapeDependencyPath(targ);
+ project->values(QLatin1String("QMAKE_INTERNAL_ET_PARSED_DEPS.") + (*it) + escapeDependencyPath(targ)) << deps.split(" ", QString::SkipEmptyParts);
+ project->values(QLatin1String("QMAKE_INTERNAL_ET_PARSED_CMD.") + (*it) + escapeDependencyPath(targ)) << cmd;
}
}
@@ -1855,17 +1855,6 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
QString dep_cmd = replaceExtraCompilerVariables(tmp_dep_cmd, (*input),
tmp_out);
dep_cmd = fixEnvVariables(dep_cmd);
-#if defined(Q_CC_MWERKS) && defined(Q_OS_WIN32)
- QPopen procPipe;
- if (procPipe.init(dep_cmd.toLatin1().constData(), "r")) {
- QString indeps;
- while(true) {
- int read_in = procPipe.fread(buff, 255);
- if(!read_in)
- break;
- indeps += QByteArray(buff, read_in);
- }
-#else
if(FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), "r")) {
QString indeps;
while(!feof(proc)) {
@@ -1875,7 +1864,6 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
indeps += QByteArray(buff, read_in);
}
QT_PCLOSE(proc);
-#endif
if(!indeps.isEmpty()) {
QStringList dep_cmd_deps = indeps.replace('\n', ' ').simplified().split(' ');
for(int i = 0; i < dep_cmd_deps.count(); ++i) {
@@ -1926,17 +1914,17 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
}
t << escapeDependencyPath(tmp_out) << ":";
- project->values(QLatin1String("QMAKE_ET_PARSED_TARGETS.") + (*it)) << escapeDependencyPath(tmp_out);
+ project->values(QLatin1String("QMAKE_INTERNAL_ET_PARSED_TARGETS.") + (*it)) << escapeDependencyPath(tmp_out);
// compiler.CONFIG+=explicit_dependencies means that ONLY compiler.depends gets to cause Makefile dependencies
if(project->values((*it) + ".CONFIG").indexOf("explicit_dependencies") != -1) {
t << " " << valList(escapeDependencyPaths(fileFixify(tmp_dep, Option::output_dir, Option::output_dir)));
- project->values(QLatin1String("QMAKE_ET_PARSED_DEPS.") + (*it) + escapeDependencyPath(tmp_out)) << tmp_dep;
+ project->values(QLatin1String("QMAKE_INTERNAL_ET_PARSED_DEPS.") + (*it) + escapeDependencyPath(tmp_out)) << tmp_dep;
} else {
t << " " << valList(escapeDependencyPaths(inputs)) << " " << valList(escapeDependencyPaths(deps));
- project->values(QLatin1String("QMAKE_ET_PARSED_DEPS.") + (*it) + escapeDependencyPath(tmp_out)) << inputs << deps;
+ project->values(QLatin1String("QMAKE_INTERNAL_ET_PARSED_DEPS.") + (*it) + escapeDependencyPath(tmp_out)) << inputs << deps;
}
t << "\n\t" << cmd << endl << endl;
- project->values(QLatin1String("QMAKE_ET_PARSED_CMD.") + (*it) + escapeDependencyPath(tmp_out)) << cmd;
+ project->values(QLatin1String("QMAKE_INTERNAL_ET_PARSED_CMD.") + (*it) + escapeDependencyPath(tmp_out)) << cmd;
continue;
}
for(QStringList::ConstIterator input = tmp_inputs.begin(); input != tmp_inputs.end(); ++input) {
@@ -1965,17 +1953,6 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
char buff[256];
QString dep_cmd = replaceExtraCompilerVariables(tmp_dep_cmd, (*input), out);
dep_cmd = fixEnvVariables(dep_cmd);
-#if defined(Q_CC_MWERKS) && defined(Q_OS_WIN32)
- QPopen procPipe;
- if (procPipe.init(dep_cmd.toLatin1().constData(), "r")) {
- QString indeps;
- while(true) {
- int read_in = procPipe.fread(buff, 255);
- if(!read_in)
- break;
- indeps += QByteArray(buff, read_in);
- }
-#else
if(FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), "r")) {
QString indeps;
while(!feof(proc)) {
@@ -1985,7 +1962,6 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
indeps += QByteArray(buff, read_in);
}
QT_PCLOSE(proc);
-#endif
if(!indeps.isEmpty()) {
QStringList dep_cmd_deps = indeps.replace('\n', ' ').simplified().split(' ');
for(int i = 0; i < dep_cmd_deps.count(); ++i) {
@@ -2060,9 +2036,9 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
}
t << escapeDependencyPath(out) << ": " << valList(escapeDependencyPaths(deps)) << "\n\t"
<< cmd << endl << endl;
- project->values(QLatin1String("QMAKE_ET_PARSED_TARGETS.") + (*it)) << escapeDependencyPath(out);
- project->values(QLatin1String("QMAKE_ET_PARSED_DEPS.") + (*it) + escapeDependencyPath(out)) << deps;
- project->values(QLatin1String("QMAKE_ET_PARSED_CMD.") + (*it) + escapeDependencyPath(out)) << cmd;
+ project->values(QLatin1String("QMAKE_INTERNAL_ET_PARSED_TARGETS.") + (*it)) << escapeDependencyPath(out);
+ project->values(QLatin1String("QMAKE_INTERNAL_ET_PARSED_DEPS.") + (*it) + escapeDependencyPath(out)) << deps;
+ project->values(QLatin1String("QMAKE_INTERNAL_ET_PARSED_CMD.") + (*it) + escapeDependencyPath(out)) << cmd;
}
}
t << "compiler_clean: " << clean_targets << endl << endl;
diff --git a/qmake/generators/makefile.h b/qmake/generators/makefile.h
index 1f72d3e..2f33969 100644
--- a/qmake/generators/makefile.h
+++ b/qmake/generators/makefile.h
@@ -53,12 +53,8 @@
QT_BEGIN_NAMESPACE
#ifdef Q_OS_WIN32
-#if defined(Q_CC_MWERKS)
-#include "qpopen.h"
-#else
#define QT_POPEN _popen
#define QT_PCLOSE _pclose
-#endif
#else
#define QT_POPEN popen
#define QT_PCLOSE pclose
@@ -88,7 +84,6 @@ class MakefileGenerator : protected QMakeSourceFileInfo
QString build_args(const QString &outdir=QString());
void checkMultipleDefinition(const QString &, const QString &);
-protected:
//internal caches
mutable QHash<QString, QMakeLocalFileName> depHeuristicsCache;
mutable QHash<QString, QStringList> dependsCache;
diff --git a/qmake/generators/metamakefile.cpp b/qmake/generators/metamakefile.cpp
index 94e6f2d..229035a 100644
--- a/qmake/generators/metamakefile.cpp
+++ b/qmake/generators/metamakefile.cpp
@@ -60,8 +60,8 @@ MetaMakefileGenerator::~MetaMakefileGenerator()
class BuildsMetaMakefileGenerator : public MetaMakefileGenerator
{
- bool init_flag;
private:
+ bool init_flag;
struct Build {
QString name, build;
MakefileGenerator *makefile;
@@ -264,7 +264,6 @@ MakefileGenerator
class SubdirsMetaMakefileGenerator : public MetaMakefileGenerator
{
protected:
-
bool init_flag;
struct Subdir {
Subdir() : makefile(0), indent(0) { }
diff --git a/qmake/generators/symbian/symmake_sbsv2.cpp b/qmake/generators/symbian/symmake_sbsv2.cpp
index f3b90c6..bf96b73 100644
--- a/qmake/generators/symbian/symmake_sbsv2.cpp
+++ b/qmake/generators/symbian/symmake_sbsv2.cpp
@@ -291,12 +291,12 @@ void SymbianSbsv2MakefileGenerator::writeBldInfExtensionRulesPart(QTextStream& t
QStringList extraTargets;
extraTargets << project->values("QMAKE_EXTRA_TARGETS") << project->values("QMAKE_EXTRA_COMPILERS");
foreach(QString item, extraTargets) {
- foreach(QString targetItem, project->values(QLatin1String("QMAKE_ET_PARSED_TARGETS.") + item)) {
+ foreach(QString targetItem, project->values(QLatin1String("QMAKE_INTERNAL_ET_PARSED_TARGETS.") + item)) {
// Make sure targetpath is absolute
QString absoluteTarget = fileInfo(targetItem).absoluteFilePath();
if (allPreDeps.contains(absoluteTarget)) {
- QStringList deps = project->values(QLatin1String("QMAKE_ET_PARSED_DEPS.") + item + targetItem);
- QString commandItem = project->values(QLatin1String("QMAKE_ET_PARSED_CMD.") + item + targetItem).join(" ");
+ QStringList deps = project->values(QLatin1String("QMAKE_INTERNAL_ET_PARSED_DEPS.") + item + targetItem);
+ QString commandItem = project->values(QLatin1String("QMAKE_INTERNAL_ET_PARSED_CMD.") + item + targetItem).join(" ");
// Make sure all deps paths are absolute
diff --git a/qmake/generators/win32/msvc_dsp.cpp b/qmake/generators/win32/msvc_dsp.cpp
index 35966b7..ebe7f81 100644
--- a/qmake/generators/win32/msvc_dsp.cpp
+++ b/qmake/generators/win32/msvc_dsp.cpp
@@ -1123,20 +1123,6 @@ QString DspMakefileGenerator::writeBuildstepForFileForConfig(const QString &file
fileOut);
dep_cmd = Option::fixPathToLocalOS(dep_cmd, true, false);
if(config->canExecute(dep_cmd)) {
-#if defined(Q_CC_MWERKS) && defined(Q_OS_WIN32)
- QPopen procPipe;
- if( procPipe.init(dep_cmd.toLatin1().constData(), "r") ) {
- QString indeps;
- while(true) {
- int read_in = procPipe.fread(buff, 255);
- if ( !read_in )
- break;
- indeps += QByteArray(buff, read_in);
- }
- if(!indeps.isEmpty())
- step.deps += config->fileFixify(indeps.replace('\n', ' ').simplified().split(' '));
- }
-#else
if(FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), "r")) {
QString indeps;
while(!feof(proc)) {
@@ -1149,7 +1135,6 @@ QString DspMakefileGenerator::writeBuildstepForFileForConfig(const QString &file
if(!indeps.isEmpty())
step.deps += config->fileFixify(indeps.replace('\n', ' ').simplified().split(' '));
}
-#endif
}
}
diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp
index 4dda30c..c192259 100644
--- a/qmake/generators/win32/msvc_objectmodel.cpp
+++ b/qmake/generators/win32/msvc_objectmodel.cpp
@@ -484,7 +484,7 @@ bool VCCLCompilerTool::parseOption(const char* option)
QString opt(option);
if (opt.contains('a') && !opt.contains('s') && !opt.contains('c'))
ExceptionHandling = ehSEH;
- else if (!opt.contains('a') && opt.contains("s-") && opt.contains("c-"))
+ else if (!opt.contains('a') && opt.contains("s-") && opt.contains("c-"))
ExceptionHandling = ehNone;
else if (!opt.contains('a') && opt.contains('s') && opt.contains('c'))
ExceptionHandling = ehNoSEH;
@@ -2215,26 +2215,6 @@ bool VCFilter::addExtraCompiler(const VCFilterFile &info)
Option::fixPathToLocalOS(inFile, true, false),
out);
if(Project->canExecute(dep_cmd)) {
-#if defined(Q_CC_MWERKS) && defined(Q_OS_WIN32)
- QPopen procPipe;
- if( procPipe.init(dep_cmd.toLatin1().constData(), "r") ) {
- QString indeps;
- while(true) {
- int read_in = procPipe.fread(buff, 255);
- if ( !read_in )
- break;
- indeps += QByteArray(buff, read_in);
- }
- if(!indeps.isEmpty()) {
- QStringList extradeps = indeps.split(QLatin1Char('\n'));
- for (int i = 0; i < extradeps.count(); ++i) {
- QString dd = extradeps.at(i).simplified();
- if (!dd.isEmpty())
- deps += Project->fileFixify(dd);
- }
- }
- }
-#else
if(FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), "r")) {
QString indeps;
while(!feof(proc)) {
@@ -2253,7 +2233,6 @@ bool VCFilter::addExtraCompiler(const VCFilterFile &info)
}
}
}
-#endif
}
}
for (int i = 0; i < deps.count(); ++i)
diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp
index 7d32dab..f2268aa 100644
--- a/qmake/generators/win32/msvc_vcproj.cpp
+++ b/qmake/generators/win32/msvc_vcproj.cpp
@@ -1261,8 +1261,8 @@ void VcprojGenerator::initDeploymentTool()
searchPath = info.absoluteFilePath();
} else {
nameFilter = source.split('\\').last();
- if (source.contains('*')) {
- source = source.split('*').first();
+ if (source.contains('*')) {
+ source = source.split('*').first();
info = QFileInfo(source);
}
searchPath = info.absolutePath();
@@ -1424,20 +1424,6 @@ void VcprojGenerator::initResourceFiles()
dep_cmd = Option::fixPathToLocalOS(dep_cmd, true, false);
if(canExecute(dep_cmd)) {
-#if defined(Q_CC_MWERKS) && defined(Q_OS_WIN32)
- QPopen procPipe;
- if( procPipe.init(dep_cmd.toLatin1().constData(), "r") ) {
- QString indeps;
- while(true) {
- int read_in = procPipe.fread(buff, 255);
- if ( !read_in )
- break;
- indeps += QByteArray(buff, read_in);
- }
- if(!indeps.isEmpty())
- deps += fileFixify(indeps.replace('\n', ' ').simplified().split(' '));
- }
-#else
if(FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), "r")) {
QString indeps;
while(!feof(proc)) {
@@ -1450,7 +1436,6 @@ void VcprojGenerator::initResourceFiles()
if(!indeps.isEmpty())
deps += fileFixify(indeps.replace('\n', ' ').simplified().split(' '));
}
-#endif
}
}
vcProject.ResourceFiles.addFiles(deps);