summaryrefslogtreecommitdiffstats
path: root/qmake
diff options
context:
space:
mode:
authorJoão Abecasis <joao.abecasis@nokia.com>2012-03-08 01:27:27 +0100
committerJoão Abecasis <joao.abecasis@nokia.com>2012-03-08 01:27:39 +0100
commit12f221410fbe41d0b2efda4cd3289dfcf9044aa8 (patch)
tree897cf6bfb1814b0935982ff5975a6cbfb48d6d9e /qmake
parent3d19422ef16a230bb11dbbfe4a8cc9667f39bf15 (diff)
parent6c612c933803ef57ea45e907d0181b40659148ac (diff)
Merge remote-tracking branch 'origin/master' into api_changes
Diffstat (limited to 'qmake')
-rw-r--r--qmake/generators/mac/pbuilder_pbx.cpp1
-rw-r--r--qmake/generators/metamakefile.cpp4
-rw-r--r--qmake/generators/win32/mingw_make.cpp8
-rw-r--r--qmake/option.cpp11
-rw-r--r--qmake/project.cpp20
-rw-r--r--qmake/project.h2
6 files changed, 25 insertions, 21 deletions
diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp
index 70efff0bcd..770a1ad34e 100644
--- a/qmake/generators/mac/pbuilder_pbx.cpp
+++ b/qmake/generators/mac/pbuilder_pbx.cpp
@@ -178,7 +178,6 @@ ProjectBuilderMakefileGenerator::writeSubDirs(QTextStream &t)
}
if(tmp_proj.first("TEMPLATE") == "subdirs") {
QMakeProject *pp = new QMakeProject(&tmp_proj);
- pp->read(0);
pb_subdirs += new ProjectBuilderSubDirs(pp, dir);
} else if(tmp_proj.first("TEMPLATE") == "app" || tmp_proj.first("TEMPLATE") == "lib") {
QString pbxproj = qmake_getpwd() + Option::dir_sep + tmp_proj.first("TARGET") + projectSuffix();
diff --git a/qmake/generators/metamakefile.cpp b/qmake/generators/metamakefile.cpp
index 39dd4ab797..b855585500 100644
--- a/qmake/generators/metamakefile.cpp
+++ b/qmake/generators/metamakefile.cpp
@@ -447,6 +447,8 @@ QT_END_INCLUDE_NAMESPACE
MakefileGenerator *
MetaMakefileGenerator::createMakefileGenerator(QMakeProject *proj, bool noIO)
{
+ Option::postProcessProject(proj);
+
MakefileGenerator *mkfile = NULL;
if(Option::qmake_mode == Option::QMAKE_GENERATE_PROJECT) {
mkfile = new ProjectGenerator;
@@ -492,6 +494,8 @@ MetaMakefileGenerator::createMakefileGenerator(QMakeProject *proj, bool noIO)
MetaMakefileGenerator *
MetaMakefileGenerator::createMetaGenerator(QMakeProject *proj, const QString &name, bool op, bool *success)
{
+ Option::postProcessProject(proj);
+
MetaMakefileGenerator *ret = 0;
if ((Option::qmake_mode == Option::QMAKE_GENERATE_MAKEFILE ||
Option::qmake_mode == Option::QMAKE_GENERATE_PRL)) {
diff --git a/qmake/generators/win32/mingw_make.cpp b/qmake/generators/win32/mingw_make.cpp
index 03460551a9..c088e8e480 100644
--- a/qmake/generators/win32/mingw_make.cpp
+++ b/qmake/generators/win32/mingw_make.cpp
@@ -404,14 +404,14 @@ void MingwMakefileGenerator::writeObjectsPart(QTextStream &t)
QString ar_cmd = project->values("QMAKE_LIB").join(" ");
if (ar_cmd.isEmpty())
ar_cmd = "armar --create";
- objectsLinkLine = ar_cmd + " " + var("DEST_TARGET") + " --via " + ar_script_file;
+ objectsLinkLine = ar_cmd + " " + var("DEST_TARGET") + " --via " + escapeFilePath(ar_script_file);
} else {
// Strip off any options since the ar commands will be read from file.
QString ar_cmd = var("QMAKE_LIB").section(" ", 0, 0);;
if (ar_cmd.isEmpty())
ar_cmd = "ar";
createArObjectScriptFile(ar_script_file, var("DEST_TARGET"), project->values("OBJECTS"));
- objectsLinkLine = ar_cmd + " -M < " + ar_script_file;
+ objectsLinkLine = ar_cmd + " -M < " + escapeFilePath(ar_script_file);
}
} else {
QString ld_script_file = var("QMAKE_LINK_OBJECT_SCRIPT") + "." + var("TARGET");
@@ -420,10 +420,10 @@ void MingwMakefileGenerator::writeObjectsPart(QTextStream &t)
}
if (project->isActiveConfig("rvct_linker")) {
createRvctObjectScriptFile(ld_script_file, project->values("OBJECTS"));
- objectsLinkLine = QString::fromLatin1("--via ") + ld_script_file;
+ objectsLinkLine = QString::fromLatin1("--via ") + escapeFilePath(ld_script_file);
} else {
createLdObjectScriptFile(ld_script_file, project->values("OBJECTS"));
- objectsLinkLine = ld_script_file;
+ objectsLinkLine = escapeFilePath(ld_script_file);
}
}
Win32MakefileGenerator::writeObjectsPart(t);
diff --git a/qmake/option.cpp b/qmake/option.cpp
index 4e0d5b198e..b2a1e6982f 100644
--- a/qmake/option.cpp
+++ b/qmake/option.cpp
@@ -149,8 +149,11 @@ static QString detectProjectFile(const QString &path)
static QString cleanSpec(const QString &spec)
{
QString ret = QDir::cleanPath(spec);
- if (ret.contains('/'))
- ret = QDir::cleanPath(QFileInfo(ret).absoluteFilePath());
+ if (ret.contains('/')) {
+ const QFileInfo specDirInfo(ret);
+ if (specDirInfo.exists() && specDirInfo.isDir())
+ ret = QDir::cleanPath(specDirInfo.absoluteFilePath());
+ }
return ret;
}
@@ -591,10 +594,12 @@ QStringList Option::mkspecPaths()
for (QStringList::ConstIterator it = lst.begin(); it != lst.end(); ++it)
ret << ((*it) + concat);
}
- ret << Option::mkfile::project_build_root + concat;
+ if (!Option::mkfile::project_build_root.isEmpty())
+ ret << Option::mkfile::project_build_root + concat;
if (!Option::mkfile::project_root.isEmpty())
ret << Option::mkfile::project_root + concat;
ret << QLibraryInfo::location(QLibraryInfo::HostDataPath) + concat;
+ ret.removeDuplicates();
return ret;
}
diff --git a/qmake/project.cpp b/qmake/project.cpp
index f6e26254c5..7655f05f2e 100644
--- a/qmake/project.cpp
+++ b/qmake/project.cpp
@@ -593,6 +593,7 @@ QStringList qmake_feature_paths(QMakeProperty *prop=0)
concat_it != concat.end(); ++concat_it)
feature_roots << (QLibraryInfo::location(QLibraryInfo::HostDataPath) +
mkspecs_concat + (*concat_it));
+ feature_roots.removeDuplicates();
return feature_roots;
}
@@ -627,10 +628,11 @@ QMakeProject::init(QMakeProperty *p)
reset();
}
-QMakeProject::QMakeProject(QMakeProject *p, const QHash<QString, QStringList> *vars)
+// Duplicate project. It is *not* allowed to call the complex read() functions on the copy.
+QMakeProject::QMakeProject(QMakeProject *p, const QHash<QString, QStringList> *_vars)
{
init(p->properties());
- base_vars = vars ? *vars : p->variables();
+ vars = _vars ? *_vars : p->variables();
for(QHash<QString, FunctionBlock*>::iterator it = p->replaceFunctions.begin(); it != p->replaceFunctions.end(); ++it) {
it.value()->ref();
replaceFunctions.insert(it.key(), it.value());
@@ -1256,7 +1258,7 @@ QMakeProject::read(const QString &project, uchar cmd)
bool
QMakeProject::read(uchar cmd)
{
- if(cfile.isEmpty()) {
+ if ((cmd & ReadSetup) && base_vars.isEmpty()) {
// hack to get the Option stuff in there
base_vars["QMAKE_EXT_CPP"] = Option::cpp_ext;
base_vars["QMAKE_EXT_C"] = Option::c_ext;
@@ -1265,12 +1267,12 @@ QMakeProject::read(uchar cmd)
if(!Option::user_template_prefix.isEmpty())
base_vars["TEMPLATE_PREFIX"] = QStringList(Option::user_template_prefix);
- if ((cmd & ReadSetup) && Option::mkfile::do_cache) { // parse the cache
+ if (Option::mkfile::do_cache) { // parse the cache
if (Option::output_dir.startsWith(Option::mkfile::project_build_root))
Option::mkfile::cachefile_depth =
Option::output_dir.mid(Option::mkfile::project_build_root.length()).count('/');
}
- if (cmd & ReadSetup) { // parse mkspec
+ { // parse mkspec
QString qmakespec = Option::mkfile::qmakespec;
while(qmakespec.endsWith(QLatin1Char('/')))
qmakespec.truncate(qmakespec.length()-1);
@@ -1306,7 +1308,6 @@ QMakeProject::read(uchar cmd)
//before commandline
if (cmd & ReadSetup) {
- cfile = pfile;
parser.file = "(internal)";
parser.from_file = false;
parser.line_no = 1; //really arg count now.. duh
@@ -1385,7 +1386,6 @@ QMakeProject::read(uchar cmd)
break;
}
}
- Option::postProcessProject(this); // let Option post-process
return true;
}
@@ -1633,12 +1633,8 @@ QMakeProject::doProjectInclude(QString file, uchar flags, QHash<QString, QString
if(flags & (IncludeFlagNewProject|IncludeFlagNewParser)) {
// The "project's variables" are used in other places (eg. export()) so it's not
// possible to use "place" everywhere. Instead just set variables and grab them later
- QMakeProject proj(this, &place);
+ QMakeProject proj(prop);
if(flags & IncludeFlagNewParser) {
-#if 1
- if(proj.doProjectInclude("default_pre", IncludeFlagFeature, proj.variables()) == IncludeNoExist)
- proj.doProjectInclude("default", IncludeFlagFeature, proj.variables());
-#endif
parsed = proj.read(file, proj.variables()); // parse just that file (fromfile, infile)
} else {
parsed = proj.read(file); // parse all aux files (load/include into)
diff --git a/qmake/project.h b/qmake/project.h
index 6422ed1f32..979f1480bd 100644
--- a/qmake/project.h
+++ b/qmake/project.h
@@ -81,7 +81,7 @@ class QMakeProject
bool recursive;
bool own_prop;
bool backslashWarned;
- QString pfile, cfile;
+ QString pfile;
QMakeProperty *prop;
void reset();
QStringList extra_configs;