summaryrefslogtreecommitdiffstats
path: root/qmake
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2013-11-26 22:30:27 +0100
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2013-11-26 22:35:48 +0100
commit4a8273a6fc2e741e811cf5dabc9a3c240306cf7f (patch)
tree2148abc88f8543eecdc0b97b2dd92594836af9b2 /qmake
parent036c5db468164297d213764c59a4b59daa76d90a (diff)
parent1c2be58fecaff1de5f2849192eb712984ebd59bd (diff)
Merge remote-tracking branch 'origin/stable' into dev
For the conflicts in msvc_nmake.cpp the ifdefs are extended since we need to support windows phone in the target branch while it is not there in the current stable branch (as of Qt 5.2). Conflicts: configure qmake/generators/win32/msvc_nmake.cpp src/3rdparty/angle/src/libEGL/Surface.cpp src/angle/src/common/common.pri src/corelib/global/qglobal.h src/corelib/io/qstandardpaths.cpp src/plugins/platforms/qnx/qqnxintegration.cpp src/plugins/platforms/qnx/qqnxscreeneventhandler.h src/plugins/platforms/xcb/qglxintegration.h src/widgets/kernel/win.pri tests/auto/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp tools/configure/configureapp.cpp Change-Id: I00b579eefebaf61d26ab9b00046d2b5bd5958812
Diffstat (limited to 'qmake')
-rw-r--r--qmake/doc/qmake.qdocconf3
-rw-r--r--qmake/doc/src/qmake-manual.qdoc2
-rw-r--r--qmake/generators/integrity/gbuild.cpp1
-rw-r--r--qmake/generators/mac/pbuilder_pbx.cpp40
-rw-r--r--qmake/generators/makefile.cpp22
-rw-r--r--qmake/generators/makefile.h1
-rw-r--r--qmake/generators/unix/unixmake2.cpp20
-rw-r--r--qmake/generators/win32/msbuild_objectmodel.cpp13
-rw-r--r--qmake/generators/win32/msvc_nmake.cpp18
-rw-r--r--qmake/generators/win32/msvc_objectmodel.cpp20
-rw-r--r--qmake/generators/win32/msvc_objectmodel.h1
-rw-r--r--qmake/generators/win32/msvc_vcproj.cpp49
-rw-r--r--qmake/library/qmakebuiltins.cpp58
-rw-r--r--qmake/library/qmakeevaluator.cpp81
-rw-r--r--qmake/library/qmakeevaluator.h1
-rw-r--r--qmake/library/qmakeglobals.h4
-rw-r--r--qmake/main.cpp3
-rw-r--r--qmake/option.cpp12
-rw-r--r--qmake/option.h1
-rw-r--r--qmake/property.cpp4
-rw-r--r--qmake/qmake.pri15
-rw-r--r--qmake/qmake.pro38
22 files changed, 235 insertions, 172 deletions
diff --git a/qmake/doc/qmake.qdocconf b/qmake/doc/qmake.qdocconf
index 537c6b3e65..a5bd089a5d 100644
--- a/qmake/doc/qmake.qdocconf
+++ b/qmake/doc/qmake.qdocconf
@@ -2,7 +2,7 @@ include($QT_INSTALL_DOCS/global/qt-module-defaults.qdocconf)
project = QMake
description = QMake Manual
-url = http://qt-project.org/doc/qt-$QT_VER/qmake
+url = http://qt-project.org/doc/qt-$QT_VER
qhp.projects = qmake
@@ -75,4 +75,3 @@ depends += \
qtx11extras \
qtxml \
qtxmlpatterns
-
diff --git a/qmake/doc/src/qmake-manual.qdoc b/qmake/doc/src/qmake-manual.qdoc
index d7624c2dc3..2eaf2cfc54 100644
--- a/qmake/doc/src/qmake-manual.qdoc
+++ b/qmake/doc/src/qmake-manual.qdoc
@@ -2773,7 +2773,7 @@
Basic test functions are implemented as built-in functions.
- \section2 cache(variablename, [set|add|sub] [transient] [super], [source variablename])
+ \section2 cache(variablename, [set|add|sub] [transient] [super|stash], [source variablename])
This is an internal function that you will typically not need.
diff --git a/qmake/generators/integrity/gbuild.cpp b/qmake/generators/integrity/gbuild.cpp
index 8a3a75b7d9..e8e992b694 100644
--- a/qmake/generators/integrity/gbuild.cpp
+++ b/qmake/generators/integrity/gbuild.cpp
@@ -417,6 +417,7 @@ QString GBuildMakefileGenerator::writeOne(QString filename, QString pathtoremove
bool
GBuildMakefileGenerator::openOutput(QFile &file, const QString &build) const
{
+ Q_UNUSED(build)
debug_msg(1, "file is %s", file.fileName().toLatin1().constData());
QFileInfo fi(file);
if (fi.filePath().isEmpty())
diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp
index 524603aa63..2674f31d03 100644
--- a/qmake/generators/mac/pbuilder_pbx.cpp
+++ b/qmake/generators/mac/pbuilder_pbx.cpp
@@ -463,12 +463,12 @@ ProjectBuilderSources::files(QMakeProject *project) const
{
QStringList ret = project->values(ProKey(key)).toQStringList();
if(key == "QMAKE_INTERNAL_INCLUDED_FILES") {
+ QStringList newret;
for(int i = 0; i < ret.size(); ++i) {
- QStringList newret;
if(!ret.at(i).endsWith(Option::prf_ext))
newret.append(ret.at(i));
- ret = newret;
}
+ ret = newret;
}
if(key == "SOURCES" && project->first("TEMPLATE") == "app" && !project->isEmpty("ICON"))
ret.append(project->first("ICON").toQString());
@@ -1260,11 +1260,33 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
<< "\t\t\t" << writeSettings("sourceTree", "<Group>") << ";\n"
<< "\t\t};\n";
+ {
+ QString aggregate_target_key = keyFor(pbx_dir + "QMAKE_PBX_AGGREGATE_TARGET");
+ project->values("QMAKE_PBX_TARGETS").append(aggregate_target_key);
+ t << "\t\t" << aggregate_target_key << " = {\n"
+ << "\t\t\t" << writeSettings("buildPhases", project->values("QMAKE_PBX_PRESCRIPT_BUILDPHASES"), SettingsAsList, 4) << ";\n"
+ << "\t\t\t" << writeSettings("dependencies", ProStringList(), SettingsAsList, 4) << ";\n"
+ << "\t\t\t" << writeSettings("buildConfigurationList", keyFor("QMAKE_PBX_BUILDCONFIG_LIST_TARGET"), SettingsNoQuote) << ";\n"
+ << "\t\t\t" << writeSettings("isa", "PBXAggregateTarget", SettingsNoQuote) << ";\n"
+ << "\t\t\t" << writeSettings("buildRules", ProStringList(), SettingsAsList) << ";\n"
+ << "\t\t\t" << writeSettings("productName", "Qt Preprocess") << ";\n"
+ << "\t\t\t" << writeSettings("name", "Qt Preprocess") << ";\n"
+ << "\t\t};\n";
+
+ QString aggregate_target_dep_key = keyFor(pbx_dir + "QMAKE_PBX_AGGREGATE_TARGET_DEP");
+ t << "\t\t" << aggregate_target_dep_key << " = {\n"
+ << "\t\t\t" << writeSettings("isa", "PBXTargetDependency", SettingsNoQuote) << ";\n"
+ << "\t\t\t" << writeSettings("target", aggregate_target_key) << ";\n"
+ << "\t\t};\n";
+
+ project->values("QMAKE_PBX_TARGET_DEPENDS").append(aggregate_target_dep_key);
+ }
+
//TARGET
QString target_key = keyFor(pbx_dir + "QMAKE_PBX_TARGET");
- project->values("QMAKE_PBX_TARGETS").append(target_key);
+ project->values("QMAKE_PBX_TARGETS").prepend(target_key);
t << "\t\t" << target_key << " = {\n"
- << "\t\t\t" << writeSettings("buildPhases", project->values("QMAKE_PBX_PRESCRIPT_BUILDPHASES") + project->values("QMAKE_PBX_BUILDPHASES"),
+ << "\t\t\t" << writeSettings("buildPhases", project->values("QMAKE_PBX_BUILDPHASES"),
SettingsAsList, 4) << ";\n";
t << "\t\t\t" << writeSettings("dependencies", project->values("QMAKE_PBX_TARGET_DEPENDS"), SettingsAsList, 4) << ";\n"
<< "\t\t\t" << writeSettings("productReference", keyFor(pbx_dir + "QMAKE_PBX_REFERENCE")) << ";\n";
@@ -1367,7 +1389,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
if ((project->first("TEMPLATE") == "app" && project->isActiveConfig("app_bundle")) ||
(project->first("TEMPLATE") == "lib" && !project->isActiveConfig("staticlib") &&
project->isActiveConfig("lib_bundle"))) {
- QString plist = fileFixify(project->first("QMAKE_INFO_PLIST").toQString());
+ QString plist = fileFixify(project->first("QMAKE_INFO_PLIST").toQString(), Option::output_dir, input_dir);
if (plist.isEmpty())
plist = specdir() + QDir::separator() + "Info.plist." + project->first("TEMPLATE");
if (exists(plist)) {
@@ -1382,7 +1404,10 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
} else {
plist_in_text = plist_in_text.replace("@LIBRARY@", project->first("QMAKE_ORIG_TARGET").toQString());
}
- plist_in_text = plist_in_text.replace("@BUNDLEIDENTIFIER@", QLatin1String("${PRODUCT_NAME:rfc1034identifier}"));
+ QString bundlePrefix = project->first("QMAKE_TARGET_BUNDLE_PREFIX").toQString();
+ if (bundlePrefix.isEmpty())
+ bundlePrefix = "com.yourcompany";
+ plist_in_text = plist_in_text.replace("@BUNDLEIDENTIFIER@", bundlePrefix + "." + QLatin1String("${PRODUCT_NAME:rfc1034identifier}"));
if (!project->values("VERSION").isEmpty()) {
plist_in_text = plist_in_text.replace("@SHORT_VERSION@", project->first("VER_MAJ") + "." +
project->first("VER_MIN"));
@@ -1397,6 +1422,8 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
t << "\t\t\t\t" << writeSettings("INFOPLIST_FILE", "Info.plist") << ";\n";
}
}
+ } else {
+ warn_msg(WarnLogic, "Could not resolve Info.plist: '%s'. Check if QMAKE_INFO_PLIST points to a valid file.", plist.toLatin1().constData());
}
}
@@ -1770,6 +1797,7 @@ ProjectBuilderMakefileGenerator::reftypeForFile(const QString &where)
QString ProjectBuilderMakefileGenerator::sourceTreeForFile(const QString &where)
{
+ Q_UNUSED(where)
// We always use absolute paths, instead of maintaining the SRCROOT
// build variable and making files relative to that.
return QLatin1String("<absolute>");
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index 9ebaf60843..d88c6e447a 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -43,6 +43,9 @@
#include "option.h"
#include "cachekeys.h"
#include "meta.h"
+
+#include <ioutils.h>
+
#include <qdir.h>
#include <qfile.h>
#include <qtextstream.h>
@@ -52,6 +55,7 @@
#include <qbuffer.h>
#include <qsettings.h>
#include <qdatetime.h>
+
#if defined(Q_OS_UNIX)
#include <unistd.h>
#else
@@ -92,7 +96,7 @@ bool MakefileGenerator::canExecute(const QStringList &cmdline, int *a) const
QString MakefileGenerator::mkdir_p_asstring(const QString &dir, bool escape) const
{
- QString edir = escape ? escapeFilePath(dir) : dir;
+ QString edir = escape ? escapeFilePath(Option::fixPathToTargetOS(dir, false, false)) : dir;
return "@" + makedir.arg(edir);
}
@@ -2261,7 +2265,7 @@ QString MakefileGenerator::buildArgs()
{
QString ret;
- foreach (const QString &arg, Option::qmake_args)
+ foreach (const QString &arg, Option::globals->qmake_args)
ret += " " + escapeFilePath(arg);
return ret;
}
@@ -3270,7 +3274,11 @@ MakefileGenerator::writePkgConfigFile()
}
}
t << "Description: " << desc << endl;
- t << "Version: " << project->first("VERSION") << endl;
+ ProString version = project->first("QMAKE_PKGCONFIG_VERSION");
+ if (version.isEmpty())
+ version = project->first("VERSION");
+ if (!version.isEmpty())
+ t << "Version: " << version << endl;
// libs
t << "Libs: ";
@@ -3341,11 +3349,17 @@ QString MakefileGenerator::installMetaFile(const ProKey &replace_rule, const QSt
const ProString match = project->first(ProKey(replace_rules.at(r) + ".match")),
replace = project->first(ProKey(replace_rules.at(r) + ".replace"));
if (!match.isEmpty() /*&& match != replace*/)
- ret += " -e \"s," + match + "," + replace + ",g\"";
+ ret += " -e " + shellQuote("s," + match + "," + replace + ",g");
}
ret += " \"" + src + "\" >\"" + dst + "\"";
}
return ret;
}
+QString MakefileGenerator::shellQuote(const QString &str)
+{
+ return isWindowsShell() ? QMakeInternal::IoUtils::shellQuoteWin(str)
+ : QMakeInternal::IoUtils::shellQuoteUnix(str);
+}
+
QT_END_NAMESPACE
diff --git a/qmake/generators/makefile.h b/qmake/generators/makefile.h
index 09327c599c..4b8a96c15f 100644
--- a/qmake/generators/makefile.h
+++ b/qmake/generators/makefile.h
@@ -271,6 +271,7 @@ public:
virtual bool mergeBuildProject(MakefileGenerator * /*other*/) { return false; }
virtual bool openOutput(QFile &, const QString &build) const;
bool isWindowsShell() const { return Option::dir_sep == QLatin1String("\\"); }
+ QString shellQuote(const QString &str);
};
inline void MakefileGenerator::setNoIO(bool o)
diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp
index 2373059f79..35639a33bf 100644
--- a/qmake/generators/unix/unixmake2.cpp
+++ b/qmake/generators/unix/unixmake2.cpp
@@ -285,13 +285,13 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << odir << ".deps/%.d: " << pwd << "/%.cpp\n\t";
if(project->isActiveConfig("echo_depend_creation"))
t << "@echo Creating depend for $<\n\t";
- t << mkdir_p_asstring("$(@D)") << "\n\t"
+ t << mkdir_p_asstring("$(@D)", false) << "\n\t"
<< "@$(CXX) " << cmd << " $< | sed \"s,^\\($(*F).o\\):," << odir << "\\1:,g\" >$@\n\n";
t << odir << ".deps/%.d: " << pwd << "/%.c\n\t";
if(project->isActiveConfig("echo_depend_creation"))
t << "@echo Creating depend for $<\n\t";
- t << mkdir_p_asstring("$(@D)") << "\n\t"
+ t << mkdir_p_asstring("$(@D)", false) << "\n\t"
<< "@$(CC) " << cmd << " $< | sed \"s,^\\($(*F).o\\):," << odir << "\\1:,g\" >$@\n\n";
static const char * const src[] = { "SOURCES", "GENERATED_SOURCES", 0 };
@@ -502,7 +502,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
incr_lflags += var("QMAKE_LFLAGS_RELEASE");
t << incr_target_dir << ": $(INCREMENTAL_OBJECTS)\n\t";
if(!destdir.isEmpty())
- t << mkdir_p_asstring(destdir) << "\n\t";
+ t << mkdir_p_asstring(destdir, false) << "\n\t";
t << "$(LINK) " << incr_lflags << " " << var("QMAKE_LINK_O_FLAG") << incr_target_dir <<
" $(INCREMENTAL_OBJECTS)\n";
//communicated below
@@ -528,7 +528,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
<< " " << var("POST_TARGETDEPS");
}
if(!destdir.isEmpty())
- t << "\n\t" << mkdir_p_asstring(destdir);
+ t << "\n\t" << mkdir_p_asstring(destdir, false);
if(!project->isEmpty("QMAKE_PRE_LINK"))
t << "\n\t" << var("QMAKE_PRE_LINK");
@@ -685,7 +685,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
if(!project->first("QMAKE_PKGINFO").isEmpty()) {
ProString pkginfo = escapeFilePath(project->first("QMAKE_PKGINFO"));
- QString destdir = escapeFilePath(project->first("DESTDIR") + project->first("QMAKE_BUNDLE") + "/Contents");
+ QString destdir = project->first("DESTDIR") + project->first("QMAKE_BUNDLE") + "/Contents";
t << pkginfo << ": \n\t";
if(!destdir.isEmpty())
t << mkdir_p_asstring(destdir) << "\n\t";
@@ -697,7 +697,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
if(!project->first("QMAKE_BUNDLE_RESOURCE_FILE").isEmpty()) {
ProString resources = escapeFilePath(project->first("QMAKE_BUNDLE_RESOURCE_FILE"));
bundledFiles << resources;
- QString destdir = escapeFilePath(project->first("DESTDIR") + project->first("QMAKE_BUNDLE") + "/Contents/Resources");
+ QString destdir = project->first("DESTDIR") + project->first("QMAKE_BUNDLE") + "/Contents/Resources";
t << resources << ": \n\t";
t << mkdir_p_asstring(destdir) << "\n\t";
t << "@touch " << resources << "\n\t\n";
@@ -710,7 +710,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
QString destdir = info_plist_out.section(Option::dir_sep, 0, -2);
t << info_plist_out << ": \n\t";
if(!destdir.isEmpty())
- t << mkdir_p_asstring(destdir) << "\n\t";
+ t << mkdir_p_asstring(destdir, false) << "\n\t";
ProStringList commonSedArgs;
if (!project->values("VERSION").isEmpty())
commonSedArgs << "-e \"s,@SHORT_VERSION@," << project->first("VER_MAJ") << "." << project->first("VER_MIN") << ",g\" ";
@@ -804,7 +804,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
project->first("OBJECTS_DIR")) + ddir,
Option::output_dir, Option::output_dir));
t << "dist: \n\t"
- << mkdir_p_asstring(ddir_c) << "\n\t"
+ << mkdir_p_asstring(ddir_c, false) << "\n\t"
<< "$(COPY_FILE) --parents $(SOURCES) $(DIST) " << ddir_c << Option::dir_sep << " && ";
if(!project->isEmpty("QMAKE_EXTRA_COMPILERS")) {
const ProStringList &quc = project->values("QMAKE_EXTRA_COMPILERS");
@@ -920,7 +920,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
t << "\t-$(DEL_FILE) " << destdir << "$(TARGET0) " << destdir << "$(TARGET1) "
<< destdir << "$(TARGET2) $(TARGETA)\n";
} else {
- t << "\t-$(DEL_FILE) $(TARGET) \n";
+ t << "\t-$(DEL_FILE) " << destdir << "$(TARGET) \n";
}
t << varGlue("QMAKE_DISTCLEAN","\t-$(DEL_FILE) "," ","\n");
{
@@ -1266,6 +1266,8 @@ void UnixMakefileGenerator::init2()
alldeps += path + Option::dir_sep + fileInfo(files[file].toQString()).fileName();
}
}
+ } else {
+ warn_msg(WarnLogic, "Could not resolve Info.plist: '%s'. Check if QMAKE_INFO_PLIST points to a valid file.", plist.toLatin1().constData());
}
}
}
diff --git a/qmake/generators/win32/msbuild_objectmodel.cpp b/qmake/generators/win32/msbuild_objectmodel.cpp
index a83f8f364b..f5a6e15a7b 100644
--- a/qmake/generators/win32/msbuild_objectmodel.cpp
+++ b/qmake/generators/win32/msbuild_objectmodel.cpp
@@ -147,6 +147,7 @@ const char _HeapReserveSize[] = "HeapReserveSize";
const char _IgnoreAllDefaultLibraries[] = "IgnoreAllDefaultLibraries";
const char _IgnoreEmbeddedIDL[] = "IgnoreEmbeddedIDL";
const char _IgnoreImportLibrary[] = "IgnoreImportLibrary";
+const char _ImageHasSafeExceptionHandlers[] = "ImageHasSafeExceptionHandlers";
const char _IgnoreSpecificDefaultLibraries[] = "IgnoreSpecificDefaultLibraries";
const char _IgnoreStandardIncludePath[] = "IgnoreStandardIncludePath";
const char _ImportLibrary[] = "ImportLibrary";
@@ -1494,6 +1495,7 @@ void VCXProjectWriter::write(XmlOutput &xml, const VCLinkerTool &tool)
<< attrTagT(_IgnoreAllDefaultLibraries, tool.IgnoreAllDefaultLibraries)
<< attrTagT(_IgnoreEmbeddedIDL, tool.IgnoreEmbeddedIDL)
<< attrTagT(_IgnoreImportLibrary, tool.IgnoreImportLibrary)
+ << attrTagT(_ImageHasSafeExceptionHandlers, tool.ImageHasSafeExceptionHandlers)
<< attrTagX(_IgnoreSpecificDefaultLibraries, tool.IgnoreDefaultLibraryNames, ";")
<< attrTagS(_ImportLibrary, tool.ImportLibrary)
<< attrTagS(_KeyContainer, tool.KeyContainer)
@@ -1760,9 +1762,6 @@ void VCXProjectWriter::outputFilter(VCProject &project, XmlOutput &xml, XmlOutpu
else
root = new XTreeNode;
- QString name, extfilter;
- triState parse;
-
for (int i = 0; i < project.SingleProjects.count(); ++i) {
VCFilter filter;
const VCProjectSingleConfig &singleCfg = project.SingleProjects.at(i);
@@ -1792,14 +1791,6 @@ void VCXProjectWriter::outputFilter(VCProject &project, XmlOutput &xml, XmlOutpu
// Merge all files in this filter to root tree
for (int x = 0; x < filter.Files.count(); ++x)
root->addElement(filter.Files.at(x));
-
- // Save filter setting from first filter. Next filters
- // may differ but we cannot handle that. (ex. extfilter)
- if (name.isEmpty()) {
- name = filter.Name;
- extfilter = filter.Filter;
- parse = filter.ParseFiles;
- }
}
if (!root->hasElements())
diff --git a/qmake/generators/win32/msvc_nmake.cpp b/qmake/generators/win32/msvc_nmake.cpp
index f50b3dd0d0..6d148e41a2 100644
--- a/qmake/generators/win32/msvc_nmake.cpp
+++ b/qmake/generators/win32/msvc_nmake.cpp
@@ -113,9 +113,7 @@ NmakeMakefileGenerator::writeMakefile(QTextStream &t)
qPrintable(variables["QMAKESPEC"].first().toQString()));
return false;
}
- }
-#ifdef Q_OS_WIN
- else if (project->isActiveConfig(QStringLiteral("winrt"))) {
+ } else if (project->isActiveConfig(QStringLiteral("winrt"))) {
QString arch = project->first("VCPROJ_ARCH").toQString().toLower();
QString compiler;
QString compilerArch;
@@ -143,6 +141,8 @@ NmakeMakefileGenerator::writeMakefile(QTextStream &t)
return false;
}
+ const bool isPhone = project->isActiveConfig(QStringLiteral("winphone"));
+#ifdef Q_OS_WIN
QString regKeyPrefix;
#if !defined(Q_OS_WIN64) && _WIN32_WINNT >= 0x0501
BOOL isWow64;
@@ -160,7 +160,6 @@ NmakeMakefileGenerator::writeMakefile(QTextStream &t)
return false;
}
- const bool isPhone = project->isActiveConfig(QStringLiteral("winphone"));
regKey = regKeyPrefix
+ (isPhone ? QStringLiteral("Microsoft\\Microsoft SDKs\\WindowsPhone\\v")
: QStringLiteral("Microsoft\\Microsoft SDKs\\Windows\\v"))
@@ -170,6 +169,10 @@ NmakeMakefileGenerator::writeMakefile(QTextStream &t)
fprintf(stderr, "Failed to find the Windows Kit installation directory.\n");
return false;
}
+#else
+ const QString vcInstallDir = "/fake/vc_install_dir";
+ const QString kitDir = "/fake/sdk_install_dir";
+#endif // Q_OS_WIN
QStringList incDirs;
QStringList libDirs;
@@ -209,7 +212,6 @@ NmakeMakefileGenerator::writeMakefile(QTextStream &t)
t << "\nLIB = " << nmakePathList(libDirs);
t << "\nPATH = " << nmakePathList(binDirs) << '\n';
}
-#endif // Q_OS_WIN
}
writeNmakeParts(t);
return MakefileGenerator::writeMakefile(t);
@@ -251,8 +253,10 @@ QString NmakeMakefileGenerator::defaultInstall(const QString &t)
if(targetdir.right(1) != Option::dir_sep)
targetdir += Option::dir_sep;
- if(t == "target" && project->first("TEMPLATE") == "lib") {
- if(project->isActiveConfig("shared") && project->isActiveConfig("debug")) {
+ if (project->isActiveConfig("debug")) {
+ if (t == "dlltarget"
+ || (project->first("TEMPLATE") == "lib"
+ && project->isActiveConfig("shared"))) {
QString pdb_target = getPdbTarget();
pdb_target.remove('"');
QString src_targ = (project->isEmpty("DESTDIR") ? QString("$(DESTDIR)") : project->first("DESTDIR")) + pdb_target;
diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp
index 09213bec8e..019bb2504d 100644
--- a/qmake/generators/win32/msvc_objectmodel.cpp
+++ b/qmake/generators/win32/msvc_objectmodel.cpp
@@ -1172,6 +1172,7 @@ VCLinkerTool::VCLinkerTool()
IgnoreAllDefaultLibraries(unset),
IgnoreEmbeddedIDL(unset),
IgnoreImportLibrary(_True),
+ ImageHasSafeExceptionHandlers(unset),
LargeAddressAware(addrAwareDefault),
LinkDLL(unset),
LinkIncremental(linkIncrementalDefault),
@@ -1198,7 +1199,6 @@ VCLinkerTool::VCLinkerTool()
TurnOffAssemblyGeneration(unset),
TypeLibraryResourceID(0),
GenerateManifest(unset),
- GenerateWindowsMetadata(unset),
EnableUAC(unset),
UACUIAccess(unset),
SectionAlignment(-1),
@@ -1206,7 +1206,8 @@ VCLinkerTool::VCLinkerTool()
AllowIsolation(unset),
AssemblyDebug(unset),
CLRUnmanagedCodeCheck(unset),
- DelaySign(unset)
+ DelaySign(unset),
+ GenerateWindowsMetadata(unset)
{
}
@@ -1654,11 +1655,12 @@ bool VCLinkerTool::parseOption(const char* option)
StackCommitSize = both[1].toLongLong();
}
break;
- case 0x75AA4D8: // /SAFESH:{NO}
- {
+ case 0x75AA4D8: // /SAFESEH:{NO}
+ if (config->CompilerVersion >= NET2010)
+ ImageHasSafeExceptionHandlers = (option[8] == ':') ? _False : _True;
+ else
AdditionalOptions += option;
- break;
- }
+ break;
case 0x9B3C00D:
case 0x78dc00d: // /SUBSYSTEM:{CONSOLE|EFI_APPLICATION|EFI_BOOT_SERVICE_DRIVER|EFI_ROM|EFI_RUNTIME_DRIVER|NATIVE|POSIX|WINDOWS|WINDOWSCE}[,major[.minor]]
{
@@ -2119,9 +2121,9 @@ VCPreLinkEventTool::VCPreLinkEventTool()
// VCConfiguration --------------------------------------------------
VCConfiguration::VCConfiguration()
- : ATLMinimizesCRunTimeLibraryUsage(unset),
- WinRT(false),
+ : WinRT(false),
WinPhone(false),
+ ATLMinimizesCRunTimeLibraryUsage(unset),
BuildBrowserInformation(unset),
CharacterSet(charSetNotSet),
ConfigurationType(typeApplication),
@@ -2859,7 +2861,7 @@ void VCProjectWriter::outputFilter(VCProject &project, XmlOutput &xml, const QSt
root = new TreeNode;
QString name, extfilter, guid;
- triState parse;
+ triState parse = unset;
for (int i = 0; i < project.SingleProjects.count(); ++i) {
VCFilter filter;
diff --git a/qmake/generators/win32/msvc_objectmodel.h b/qmake/generators/win32/msvc_objectmodel.h
index 4e19a43a8c..58b528301c 100644
--- a/qmake/generators/win32/msvc_objectmodel.h
+++ b/qmake/generators/win32/msvc_objectmodel.h
@@ -615,6 +615,7 @@ public:
QStringList IgnoreDefaultLibraryNames;
triState IgnoreEmbeddedIDL;
triState IgnoreImportLibrary;
+ triState ImageHasSafeExceptionHandlers;
QString ImportLibrary;
addressAwarenessType LargeAddressAware;
triState LinkDLL;
diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp
index a30129fa27..934902fd4a 100644
--- a/qmake/generators/win32/msvc_vcproj.cpp
+++ b/qmake/generators/win32/msvc_vcproj.cpp
@@ -124,17 +124,17 @@ DotNET which_dotnet_version()
// Fallback to .NET 2002
current_version = NET2002;
- QStringList warnPath;
+ const DotNetCombo *lowestInstalledVersion = 0;
QHash<DotNET, QString> installPaths;
int installed = 0;
int i = 0;
for(; dotNetCombo[i].version; ++i) {
QString path = qt_readRegistryKey(HKEY_LOCAL_MACHINE, dotNetCombo[i].regKey);
if (!path.isEmpty() && installPaths.value(dotNetCombo[i].version) != path) {
- installPaths.insert(dotNetCombo[i].version, path);
+ lowestInstalledVersion = &dotNetCombo[i];
+ installPaths.insert(lowestInstalledVersion->version, path);
++installed;
- current_version = dotNetCombo[i].version;
- warnPath += QString("%1").arg(dotNetCombo[i].versionStr);
+ current_version = lowestInstalledVersion->version;
}
}
@@ -143,35 +143,20 @@ DotNET which_dotnet_version()
// More than one version installed, search directory path
QString paths = qgetenv("PATH");
- QStringList pathlist = paths.toLower().split(";");
-
- i = installed = 0;
- for(; dotNetCombo[i].version; ++i) {
- QString productPath = qt_readRegistryKey(HKEY_LOCAL_MACHINE, dotNetCombo[i].regKey).toLower();
- if (productPath.isEmpty())
- continue;
- QStringList::iterator it;
- for(it = pathlist.begin(); it != pathlist.end(); ++it) {
- if((*it).contains(productPath)) {
- ++installed;
- current_version = dotNetCombo[i].version;
- warnPath += QString("%1 in path").arg(dotNetCombo[i].versionStr);
- break;
- }
+ const QStringList pathlist = paths.split(QLatin1Char(';'));
+ foreach (const QString &path, pathlist) {
+ for (i = 0; dotNetCombo[i].version; ++i) {
+ const QString productPath = installPaths.value(dotNetCombo[i].version);
+ if (productPath.isEmpty())
+ continue;
+ if (path.startsWith(productPath, Qt::CaseInsensitive))
+ return dotNetCombo[i].version;
}
}
- switch(installed) {
- case 1:
- break;
- case 0:
- warn_msg(WarnLogic, "Generator: MSVC.NET: Found more than one version of Visual Studio, but"
- " none in your path! Fallback to lowest version (%s)", warnPath.join(", ").toLatin1().data());
- break;
- default:
- warn_msg(WarnLogic, "Generator: MSVC.NET: Found more than one version of Visual Studio in"
- " your path! Fallback to lowest version (%s)", warnPath.join(", ").toLatin1().data());
- break;
- }
+
+ warn_msg(WarnLogic, "Generator: MSVC.NET: Found more than one version of Visual Studio, but"
+ " none in your PATH. Falling back to lowest version (%s)",
+ qPrintable(lowestInstalledVersion->versionStr));
return current_version;
#endif
@@ -514,7 +499,7 @@ ProStringList VcprojGenerator::collectDependencies(QMakeProject *proj, QHash<QSt
// We want to store it as the .lib name.
if (newDep->target.endsWith(".dll"))
newDep->target = newDep->target.left(newDep->target.length()-3) + "lib";
- projGuids.insert(val.first, newDep->target);
+ projGuids.insert(newDep->orig_target, newDep->target);
if (val.second.size()) {
const ProStringList depends = val.second;
diff --git a/qmake/library/qmakebuiltins.cpp b/qmake/library/qmakebuiltins.cpp
index 9cefbc8572..96de34fd14 100644
--- a/qmake/library/qmakebuiltins.cpp
+++ b/qmake/library/qmakebuiltins.cpp
@@ -1590,11 +1590,11 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
}
case T_CACHE: {
if (args.count() > 3) {
- evalError(fL1S("cache(var, [set|add|sub] [transient] [super], [srcvar]) requires one to three arguments."));
+ evalError(fL1S("cache(var, [set|add|sub] [transient] [super|stash], [srcvar]) requires one to three arguments."));
return ReturnFalse;
}
bool persist = true;
- bool super = false;
+ enum { TargetStash, TargetCache, TargetSuper } target = TargetCache;
enum { CacheSet, CacheAdd, CacheSub } mode = CacheSet;
ProKey srcvar;
if (args.count() >= 2) {
@@ -1603,7 +1603,9 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
if (m_tmp3 == QLatin1String("transient")) {
persist = false;
} else if (m_tmp3 == QLatin1String("super")) {
- super = true;
+ target = TargetSuper;
+ } else if (m_tmp3 == QLatin1String("stash")) {
+ target = TargetStash;
} else if (m_tmp3 == QLatin1String("set")) {
mode = CacheSet;
} else if (m_tmp3 == QLatin1String("add")) {
@@ -1642,7 +1644,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
m_option->mutex.lock();
#endif
QMakeBaseEnv *baseEnv =
- m_option->baseEnvs.value(QMakeBaseKey(m_buildRoot, hostBuild));
+ m_option->baseEnvs.value(QMakeBaseKey(m_buildRoot, m_stashfile, hostBuild));
#ifdef PROEVALUATOR_THREAD_SAFE
// It's ok to unlock this before locking baseEnv,
// as we have no intention to initialize the env.
@@ -1675,21 +1677,23 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
removeEach(&newval, diffval);
}
if (oldval != newval) {
- baseEval->valuesRef(dstvar) = newval;
- if (super) {
- do {
- if (dstvar == QLatin1String("QMAKEPATH")) {
- baseEval->m_qmakepath = newval.toQStringList();
- baseEval->updateMkspecPaths();
- } else if (dstvar == QLatin1String("QMAKEFEATURES")) {
- baseEval->m_qmakefeatures = newval.toQStringList();
- } else {
- break;
- }
- baseEval->updateFeaturePaths();
- if (hostBuild == m_hostBuild)
- m_featureRoots = baseEval->m_featureRoots;
- } while (false);
+ if (target != TargetStash || !m_stashfile.isEmpty()) {
+ baseEval->valuesRef(dstvar) = newval;
+ if (target == TargetSuper) {
+ do {
+ if (dstvar == QLatin1String("QMAKEPATH")) {
+ baseEval->m_qmakepath = newval.toQStringList();
+ baseEval->updateMkspecPaths();
+ } else if (dstvar == QLatin1String("QMAKEFEATURES")) {
+ baseEval->m_qmakefeatures = newval.toQStringList();
+ } else {
+ break;
+ }
+ baseEval->updateFeaturePaths();
+ if (hostBuild == m_hostBuild)
+ m_featureRoots = baseEval->m_featureRoots;
+ } while (false);
+ }
}
changed = true;
}
@@ -1720,16 +1724,16 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
varstr += QLatin1Char('\n');
}
QString fn;
- if (super) {
+ if (target == TargetSuper) {
if (m_superfile.isEmpty()) {
- m_superfile = m_outputDir + QLatin1String("/.qmake.super");
+ m_superfile = QDir::cleanPath(m_outputDir + QLatin1String("/.qmake.super"));
printf("Info: creating super cache file %s\n", qPrintable(m_superfile));
valuesRef(ProKey("_QMAKE_SUPER_CACHE_")) << ProString(m_superfile);
}
fn = m_superfile;
- } else {
+ } else if (target == TargetCache) {
if (m_cachefile.isEmpty()) {
- m_cachefile = m_outputDir + QLatin1String("/.qmake.cache");
+ m_cachefile = QDir::cleanPath(m_outputDir + QLatin1String("/.qmake.cache"));
printf("Info: creating cache file %s\n", qPrintable(m_cachefile));
valuesRef(ProKey("_QMAKE_CACHE_")) << ProString(m_cachefile);
// We could update m_{source,build}Root and m_featureRoots here, or even
@@ -1739,6 +1743,14 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
// The sub-projects will find the new cache all by themselves.
}
fn = m_cachefile;
+ } else {
+ fn = m_stashfile;
+ if (fn.isEmpty())
+ fn = QDir::cleanPath(m_outputDir + QLatin1String("/.qmake.stash"));
+ if (!m_vfs->exists(fn)) {
+ printf("Info: creating stash file %s\n", qPrintable(fn));
+ valuesRef(ProKey("_QMAKE_STASH_")) << ProString(fn);
+ }
}
return writeFile(fL1S("cache "), fn, QIODevice::Append, varstr);
}
diff --git a/qmake/library/qmakeevaluator.cpp b/qmake/library/qmakeevaluator.cpp
index c4dca12900..f46eb75670 100644
--- a/qmake/library/qmakeevaluator.cpp
+++ b/qmake/library/qmakeevaluator.cpp
@@ -79,19 +79,19 @@ QT_BEGIN_NAMESPACE
#define fL1S(s) QString::fromLatin1(s)
-QMakeBaseKey::QMakeBaseKey(const QString &_root, bool _hostBuild)
- : root(_root), hostBuild(_hostBuild)
+QMakeBaseKey::QMakeBaseKey(const QString &_root, const QString &_stash, bool _hostBuild)
+ : root(_root), stash(_stash), hostBuild(_hostBuild)
{
}
uint qHash(const QMakeBaseKey &key)
{
- return qHash(key.root) ^ (uint)key.hostBuild;
+ return qHash(key.root) ^ qHash(key.stash) ^ (uint)key.hostBuild;
}
bool operator==(const QMakeBaseKey &one, const QMakeBaseKey &two)
{
- return one.root == two.root && one.hostBuild == two.hostBuild;
+ return one.root == two.root && one.stash == two.stash && one.hostBuild == two.hostBuild;
}
QMakeBaseEnv::QMakeBaseEnv()
@@ -982,6 +982,8 @@ void QMakeEvaluator::loadDefaults()
vars[ProKey("_DATE_")] << ProString(QDateTime::currentDateTime().toString());
if (!m_option->qmake_abslocation.isEmpty())
vars[ProKey("QMAKE_QMAKE")] << ProString(m_option->qmake_abslocation);
+ if (!m_option->qmake_args.isEmpty())
+ vars[ProKey("QMAKE_ARGS")] = ProStringList(m_option->qmake_args);
#if defined(Q_OS_WIN32)
vars[ProKey("QMAKE_HOST.os")] << ProString("Windows");
@@ -1137,6 +1139,19 @@ bool QMakeEvaluator::prepareProject(const QString &inDir)
dir = qdfi.path();
}
+ dir = m_outputDir;
+ forever {
+ QString stashfile = dir + QLatin1String("/.qmake.stash");
+ if (dir == (!superdir.isEmpty() ? superdir : m_buildRoot) || m_vfs->exists(stashfile)) {
+ m_stashfile = QDir::cleanPath(stashfile);
+ break;
+ }
+ QFileInfo qdfi(dir);
+ if (qdfi.isRoot())
+ break;
+ dir = qdfi.path();
+ }
+
return true;
}
@@ -1186,23 +1201,18 @@ bool QMakeEvaluator::loadSpec()
QMakeEvaluator evaluator(m_option, m_parser, m_vfs, m_handler);
evaluator.m_sourceRoot = m_sourceRoot;
evaluator.m_buildRoot = m_buildRoot;
- if (!m_superfile.isEmpty()) {
- valuesRef(ProKey("_QMAKE_SUPER_CACHE_")) << ProString(m_superfile);
- if (evaluator.evaluateFile(
- m_superfile, QMakeHandler::EvalConfigFile, LoadProOnly) != ReturnTrue)
- return false;
+
+ if (!m_superfile.isEmpty() && evaluator.evaluateFile(
+ m_superfile, QMakeHandler::EvalConfigFile, LoadProOnly|LoadHidden) != ReturnTrue) {
+ return false;
}
- if (!m_conffile.isEmpty()) {
- valuesRef(ProKey("_QMAKE_CONF_")) << ProString(m_conffile);
- if (evaluator.evaluateFile(
- m_conffile, QMakeHandler::EvalConfigFile, LoadProOnly) != ReturnTrue)
- return false;
+ if (!m_conffile.isEmpty() && evaluator.evaluateFile(
+ m_conffile, QMakeHandler::EvalConfigFile, LoadProOnly|LoadHidden) != ReturnTrue) {
+ return false;
}
- if (!m_cachefile.isEmpty()) {
- valuesRef(ProKey("_QMAKE_CACHE_")) << ProString(m_cachefile);
- if (evaluator.evaluateFile(
- m_cachefile, QMakeHandler::EvalConfigFile, LoadProOnly) != ReturnTrue)
- return false;
+ if (!m_cachefile.isEmpty() && evaluator.evaluateFile(
+ m_cachefile, QMakeHandler::EvalConfigFile, LoadProOnly|LoadHidden) != ReturnTrue) {
+ return false;
}
if (qmakespec.isEmpty()) {
if (!m_hostBuild)
@@ -1236,19 +1246,31 @@ bool QMakeEvaluator::loadSpec()
cool:
m_qmakespec = QDir::cleanPath(qmakespec);
- if (!m_superfile.isEmpty()
- && evaluateFile(m_superfile, QMakeHandler::EvalConfigFile, LoadProOnly|LoadHidden) != ReturnTrue) {
- return false;
+ if (!m_superfile.isEmpty()) {
+ valuesRef(ProKey("_QMAKE_SUPER_CACHE_")) << ProString(m_superfile);
+ if (evaluateFile(
+ m_superfile, QMakeHandler::EvalConfigFile, LoadProOnly|LoadHidden) != ReturnTrue)
+ return false;
}
if (!loadSpecInternal())
return false;
- if (!m_conffile.isEmpty()
- && evaluateFile(m_conffile, QMakeHandler::EvalConfigFile, LoadProOnly) != ReturnTrue) {
- return false;
+ if (!m_conffile.isEmpty()) {
+ valuesRef(ProKey("_QMAKE_CONF_")) << ProString(m_conffile);
+ if (evaluateFile(
+ m_conffile, QMakeHandler::EvalConfigFile, LoadProOnly) != ReturnTrue)
+ return false;
}
- if (!m_cachefile.isEmpty()
- && evaluateFile(m_cachefile, QMakeHandler::EvalConfigFile, LoadProOnly) != ReturnTrue) {
- return false;
+ if (!m_cachefile.isEmpty()) {
+ valuesRef(ProKey("_QMAKE_CACHE_")) << ProString(m_cachefile);
+ if (evaluateFile(
+ m_cachefile, QMakeHandler::EvalConfigFile, LoadProOnly) != ReturnTrue)
+ return false;
+ }
+ if (!m_stashfile.isEmpty() && m_vfs->exists(m_stashfile)) {
+ valuesRef(ProKey("_QMAKE_STASH_")) << ProString(m_stashfile);
+ if (evaluateFile(
+ m_stashfile, QMakeHandler::EvalConfigFile, LoadProOnly) != ReturnTrue)
+ return false;
}
return true;
}
@@ -1327,7 +1349,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::visitProFile(
#ifdef PROEVALUATOR_THREAD_SAFE
m_option->mutex.lock();
#endif
- QMakeBaseEnv **baseEnvPtr = &m_option->baseEnvs[QMakeBaseKey(m_buildRoot, m_hostBuild)];
+ QMakeBaseEnv **baseEnvPtr = &m_option->baseEnvs[QMakeBaseKey(m_buildRoot, m_stashfile, m_hostBuild)];
if (!*baseEnvPtr)
*baseEnvPtr = new QMakeBaseEnv;
QMakeBaseEnv *baseEnv = *baseEnvPtr;
@@ -1354,6 +1376,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::visitProFile(
baseEval->m_superfile = m_superfile;
baseEval->m_conffile = m_conffile;
baseEval->m_cachefile = m_cachefile;
+ baseEval->m_stashfile = m_stashfile;
baseEval->m_sourceRoot = m_sourceRoot;
baseEval->m_buildRoot = m_buildRoot;
baseEval->m_hostBuild = m_hostBuild;
diff --git a/qmake/library/qmakeevaluator.h b/qmake/library/qmakeevaluator.h
index c1e7037762..de13033481 100644
--- a/qmake/library/qmakeevaluator.h
+++ b/qmake/library/qmakeevaluator.h
@@ -298,6 +298,7 @@ public:
QString m_superfile;
QString m_conffile;
QString m_cachefile;
+ QString m_stashfile;
QString m_sourceRoot;
QString m_buildRoot;
QStringList m_qmakepath;
diff --git a/qmake/library/qmakeglobals.h b/qmake/library/qmakeglobals.h
index b305b495bc..1f217138b4 100644
--- a/qmake/library/qmakeglobals.h
+++ b/qmake/library/qmakeglobals.h
@@ -66,9 +66,10 @@ class QMakeEvaluator;
class QMakeBaseKey
{
public:
- QMakeBaseKey(const QString &_root, bool _hostBuild);
+ QMakeBaseKey(const QString &_root, const QString &_stash, bool _hostBuild);
QString root;
+ QString stash;
bool hostBuild;
};
@@ -117,6 +118,7 @@ public:
QProcessEnvironment environment;
#endif
QString qmake_abslocation;
+ QStringList qmake_args;
QString qmakespec, xqmakespec;
QString user_template, user_template_prefix;
diff --git a/qmake/main.cpp b/qmake/main.cpp
index b1929e0d21..79e3739f56 100644
--- a/qmake/main.cpp
+++ b/qmake/main.cpp
@@ -106,7 +106,7 @@ static int doSed(int argc, char **argv)
}
}
if (phase == 1
- && (c == QLatin1Char('+') || c == QLatin1Char('?')
+ && (c == QLatin1Char('+') || c == QLatin1Char('?') || c == QLatin1Char('|')
|| c == QLatin1Char('{') || c == QLatin1Char('}')
|| c == QLatin1Char('(') || c == QLatin1Char(')'))) {
// translate sed rx to QRegExp
@@ -133,6 +133,7 @@ static int doSed(int argc, char **argv)
SedSubst subst;
subst.from = QRegExp(phases.at(0));
subst.to = phases.at(1);
+ subst.to.replace("\\\\", "\\"); // QString::replace(rx, sub) groks \1, but not \\.
substs << subst;
}
} else if (argv[i][0] == '-' && argv[i][1] != 0) {
diff --git a/qmake/option.cpp b/qmake/option.cpp
index da52542a7d..7b93144d82 100644
--- a/qmake/option.cpp
+++ b/qmake/option.cpp
@@ -82,7 +82,6 @@ char Option::field_sep;
Option::QMAKE_MODE Option::qmake_mode = Option::QMAKE_GENERATE_NOTHING;
//all modes
-QStringList Option::qmake_args;
int Option::warn_level = WarnLogic | WarnDeprecated;
int Option::debug_level = 0;
QFile Option::output;
@@ -436,7 +435,7 @@ Option::init(int argc, char **argv)
return ret;
//return ret == QMAKE_CMDLINE_SHOW_USAGE ? usage(argv[0]) : false;
}
- Option::qmake_args = args;
+ globals->qmake_args = args;
}
globals->commitCommandLineArguments(cmdstate);
globals->debugLevel = Option::debug_level;
@@ -532,12 +531,11 @@ Option::fixString(QString string, uchar flags)
string = QDir::cleanPath(string);
}
- bool localSep = (flags & Option::FixPathToLocalSeparators) != 0;
- bool targetSep = (flags & Option::FixPathToTargetSeparators) != 0;
- bool normalSep = (flags & Option::FixPathToNormalSeparators) != 0;
-
// either none or only one active flag
- Q_ASSERT(localSep + targetSep + normalSep <= 1);
+ Q_ASSERT(((flags & Option::FixPathToLocalSeparators) != 0) +
+ ((flags & Option::FixPathToTargetSeparators) != 0) +
+ ((flags & Option::FixPathToNormalSeparators) != 0) <= 1);
+
//fix separators
if (flags & Option::FixPathToNormalSeparators) {
string = string.replace('\\', '/');
diff --git a/qmake/option.h b/qmake/option.h
index af8e3b7ab8..d0436fe844 100644
--- a/qmake/option.h
+++ b/qmake/option.h
@@ -178,7 +178,6 @@ struct Option
static QMAKE_MODE qmake_mode;
//all modes
- static QStringList qmake_args;
static QFile output;
static QString output_dir;
static int debug_level;
diff --git a/qmake/property.cpp b/qmake/property.cpp
index 38d454cb5d..e50485ce19 100644
--- a/qmake/property.cpp
+++ b/qmake/property.cpp
@@ -81,7 +81,7 @@ static const struct {
QMakeProperty::QMakeProperty() : settings(0)
{
- for (int i = 0; i < sizeof(propList)/sizeof(propList[0]); i++) {
+ for (unsigned i = 0; i < sizeof(propList)/sizeof(propList[0]); i++) {
QString name = QString::fromLatin1(propList[i].name);
m_values[ProKey(name + "/src")] = QLibraryInfo::rawLocation(propList[i].loc, QLibraryInfo::EffectiveSourcePaths);
m_values[ProKey(name + "/get")] = QLibraryInfo::rawLocation(propList[i].loc, QLibraryInfo::EffectivePaths);
@@ -155,7 +155,7 @@ QMakeProperty::exec()
fprintf(stdout, "%s:%s\n", qPrintable(key), qPrintable(val));
}
QStringList specialProps;
- for (int i = 0; i < sizeof(propList)/sizeof(propList[0]); i++)
+ for (unsigned i = 0; i < sizeof(propList)/sizeof(propList[0]); i++)
specialProps.append(QString::fromLatin1(propList[i].name));
specialProps.append("QMAKE_VERSION");
#ifdef QT_VERSION_STR
diff --git a/qmake/qmake.pri b/qmake/qmake.pri
index 5012bd0206..661b787a55 100644
--- a/qmake/qmake.pri
+++ b/qmake/qmake.pri
@@ -1,6 +1,3 @@
-SKIP_DEPENDS += qconfig.h qmodules.h
-DEFINES += QT_NO_TEXTCODEC QT_NO_LIBRARY QT_NO_COMPRESS QT_NO_UNICODETABLES \
- QT_NO_GEOM_VARIANT QT_NO_DATASTREAM
#qmake code
SOURCES += project.cpp property.cpp main.cpp \
@@ -37,7 +34,6 @@ contains(QT_EDITION, OpenSource) {
}
bootstrap { #Qt code
- DEFINES+=QT_NO_THREAD
SOURCES+= \
qbitarray.cpp \
qbuffer.cpp \
@@ -160,7 +156,16 @@ bootstrap { #Qt code
CFLAGS += -fhonor-std
LFLAGS += -lcpp
}
- DEFINES *= QT_NO_QOBJECT QT_CRYPTOGRAPHICHASH_ONLY_SHA1
+
+ DEFINES += \
+ QT_BOOTSTRAPPED \
+ QT_NO_TEXTCODEC QT_NO_UNICODETABLES QT_NO_COMPONENT QT_NO_COMPRESS \
+ QT_NO_THREAD QT_NO_QOBJECT QT_NO_GEOM_VARIANT QT_NO_DATASTREAM \
+ QT_CRYPTOGRAPHICHASH_ONLY_SHA1 QT_JSON_READONLY
+
+ INCLUDEPATH += \
+ $$QT.core.includes $$QT.core_private.includes \
+ $$shadowed(../src/corelib/global)
} else {
CONFIG += qt
QT = core
diff --git a/qmake/qmake.pro b/qmake/qmake.pro
index e680942716..89d6ea5fc1 100644
--- a/qmake/qmake.pro
+++ b/qmake/qmake.pro
@@ -4,24 +4,21 @@
option(host_build)
CONFIG += console bootstrap
-CONFIG -= qt shared app_bundle uic
-DEFINES += QT_BUILD_QMAKE QT_BOOTSTRAPPED \
+CONFIG -= qt
+DEFINES += \
+ QT_BUILD_QMAKE \
PROEVALUATOR_FULL
-DESTDIR = ../bin/
-OBJECTS_DIR = .
-MOC_DIR = .
-
-#guts
-VPATH += $$QT_SOURCE_TREE/src/corelib/global \
- $$QT_SOURCE_TREE/src/corelib/tools \
- $$QT_SOURCE_TREE/src/corelib/kernel \
- $$QT_SOURCE_TREE/src/corelib/codecs \
- $$QT_SOURCE_TREE/src/corelib/plugin \
- $$QT_SOURCE_TREE/src/corelib/xml \
- $$QT_SOURCE_TREE/src/corelib/io \
- $$QT_SOURCE_TREE/src/corelib/json \
- $$QT_SOURCE_TREE/tools/shared/windows
+VPATH += \
+ ../src/corelib/global \
+ ../src/corelib/tools \
+ ../src/corelib/kernel \
+ ../src/corelib/codecs \
+ ../src/corelib/plugin \
+ ../src/corelib/xml \
+ ../src/corelib/io \
+ ../src/corelib/json \
+ ../tools/shared/windows
INCLUDEPATH += . \
library \
@@ -30,11 +27,8 @@ INCLUDEPATH += . \
generators/win32 \
generators/mac \
generators/integrity \
- $$QT_SOURCE_TREE/include \
- $$QT_SOURCE_TREE/include/QtCore \
- $$QT_SOURCE_TREE/include/QtCore/$$QT_VERSION \
- $$QT_SOURCE_TREE/include/QtCore/$$QT_VERSION/QtCore \
- $$QT_SOURCE_TREE/tools/shared \
- $$QT_SOURCE_TREE/qmake
+ ../tools/shared
include(qmake.pri)
+
+load(qt_app)