summaryrefslogtreecommitdiff
path: root/qmake
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-11-17 14:15:53 +0100
committerLiang Qi <liang.qi@qt.io>2016-11-17 14:43:26 +0100
commite5ac4afbf954a3e1616ce8543d46ddc668d0374f (patch)
treebe6d97001edebd5cb74c64aaf0010f3cc76a7293 /qmake
parente3ed95dd44b95b6e9361b562807e711d7ce5a58b (diff)
parent03c1a6ac717e3c5693653a5e294214056bda970e (diff)
downloadqtbase-e5ac4afbf954a3e1616ce8543d46ddc668d0374f.tar.gz
Merge remote-tracking branch 'origin/5.8' into dev
Conflicts: mkspecs/features/mac/default_post.prf mkspecs/features/uikit/default_post.prf Change-Id: I2a6f783451f2ac9eb4c1a050f605435d2dacf218
Diffstat (limited to 'qmake')
-rw-r--r--qmake/Makefile.win329
-rw-r--r--qmake/doc/src/qmake-manual.qdoc17
-rw-r--r--qmake/generators/makefile.cpp6
-rw-r--r--qmake/generators/win32/msbuild_objectmodel.cpp17
-rw-r--r--qmake/generators/win32/msvc_objectmodel.cpp4
-rw-r--r--qmake/generators/win32/msvc_objectmodel.h5
-rw-r--r--qmake/library/qmakebuiltins.cpp76
-rw-r--r--qmake/option.cpp8
-rw-r--r--qmake/option.h2
-rw-r--r--qmake/property.cpp53
10 files changed, 144 insertions, 53 deletions
diff --git a/qmake/Makefile.win32 b/qmake/Makefile.win32
index 080662f772..f023dc9e3f 100644
--- a/qmake/Makefile.win32
+++ b/qmake/Makefile.win32
@@ -53,7 +53,6 @@ CXXFLAGS = $(CFLAGS)
LFLAGS =
LIBS = ole32.lib advapi32.lib shell32.lib
-LINKQMAKE = $(LINKER) $(LFLAGS) -OUT:qmake.exe $(OBJS) $(QTOBJS) $(LIBS)
ADDCLEAN = qmake.pdb qmake.ilk
#qmake code
@@ -132,11 +131,10 @@ QTOBJS= \
qjsonobject.obj \
qjsonvalue.obj
-first all: qmake.exe
+first all: $(BUILD_PATH)\bin\qmake.exe
-qmake.exe: $(OBJS) $(QTOBJS)
- $(LINKQMAKE) $(PCH_OBJECT)
- -copy qmake.exe $(BUILD_PATH)\bin\qmake.exe
+$(BUILD_PATH)\bin\qmake.exe: $(OBJS) $(QTOBJS)
+ $(LINKER) $(LFLAGS) /OUT:$(BUILD_PATH)\bin\qmake.exe $(OBJS) $(QTOBJS) $(PCH_OBJECT) $(LIBS)
clean::
-del $(QTOBJS)
@@ -148,7 +146,6 @@ clean::
-del qmake.tds
distclean:: clean
- -del qmake.exe
-del $(BUILD_PATH)\bin\qmake.exe
-del Makefile
diff --git a/qmake/doc/src/qmake-manual.qdoc b/qmake/doc/src/qmake-manual.qdoc
index 1cfe4c9979..aa6c8b35cc 100644
--- a/qmake/doc/src/qmake-manual.qdoc
+++ b/qmake/doc/src/qmake-manual.qdoc
@@ -2596,6 +2596,10 @@
\li Specifies device capabilities to add to the capability list
(location, webcam, and so on).
\row
+ \li CONFIG
+ \li Specifies additional flags for processing the input manifest file.
+ Currently, \c{verbatim} is the only available option.
+ \row
\li default_language
\li The default language code of the application. Defaults to "en".
\row
@@ -2727,6 +2731,14 @@
WINRT_MANIFEST = someManifest.xml.in
\endcode
+ In case the input manifest file should not be processed and only copied to
+ the target directory, the verbatim configuration needs to be set.
+
+ \code
+ WINRT_MANIFEST = someManifest.xml.in
+ WINRT_MANIFEST.CONFIG += verbatim
+ \endcode
+
\note The required image sizes of \e logo_small, \e logo_medium, and \e logo_large
depend on the target platform. The general descriptions are overwritten if a
description that specifies the size is provided.
@@ -3006,10 +3018,13 @@
sum = $$num_add($$first, $$second_neg)
\endcode
- \section2 prompt(question)
+ \section2 prompt(question [, decorate])
Displays the specified \c question, and returns a value read from stdin.
+ If \c decorate is \e true (the default), the question gets a generic
+ prefix and suffix identifying it as a prompt.
+
\section2 quote(string)
Converts a whole \c string into a single entity and returns the result.
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index 5d7700ec82..4450e619b9 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -2623,8 +2623,8 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
for (ProStringList::ConstIterator dep_it = deplist.begin(); dep_it != deplist.end(); ++dep_it) {
QString dep = var(ProKey(*dep_it + ".target"));
if(dep.isEmpty())
- dep = Option::fixPathToTargetOS((*dep_it).toQString(), false);
- deps += ' ' + escapeDependencyPath(dep);
+ dep = (*dep_it).toQString();
+ deps += ' ' + escapeDependencyPath(Option::fixPathToTargetOS(dep, false));
}
if (config.indexOf("recursive") != -1) {
QSet<QString> recurse;
@@ -2690,7 +2690,7 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
}
if (config.indexOf("phony") != -1)
deps += " FORCE";
- t << targ << ":" << deps << "\n";
+ t << escapeDependencyPath(Option::fixPathToTargetOS(targ, false)) << ":" << deps << "\n";
if(!cmd.isEmpty())
t << "\t" << cmd << endl;
}
diff --git a/qmake/generators/win32/msbuild_objectmodel.cpp b/qmake/generators/win32/msbuild_objectmodel.cpp
index 4539058cbf..914505a362 100644
--- a/qmake/generators/win32/msbuild_objectmodel.cpp
+++ b/qmake/generators/win32/msbuild_objectmodel.cpp
@@ -1158,6 +1158,21 @@ static inline QString toString(subSystemOption option)
return QString();
}
+static inline QString toString(triState genDebugInfo, linkerDebugOption option)
+{
+ switch (genDebugInfo) {
+ case unset:
+ break;
+ case _False:
+ return "false";
+ case _True:
+ if (option == linkerDebugOptionFastLink)
+ return "DebugFastLink";
+ return "true";
+ }
+ return QString();
+}
+
static inline QString toString(machineTypeOption option)
{
switch (option) {
@@ -1536,7 +1551,7 @@ void VCXProjectWriter::write(XmlOutput &xml, const VCLinkerTool &tool)
<< attrTagS(_EntryPointSymbol, tool.EntryPointSymbol)
<< attrTagX(_ForceSymbolReferences, tool.ForceSymbolReferences, ";")
<< attrTagS(_FunctionOrder, tool.FunctionOrder)
- << attrTagT(_GenerateDebugInformation, tool.GenerateDebugInformation)
+ << attrTagS(_GenerateDebugInformation, toString(tool.GenerateDebugInformation, tool.DebugInfoOption))
<< attrTagT(_GenerateManifest, tool.GenerateManifest)
<< attrTagT(_GenerateWindowsMetadata, tool.GenerateWindowsMetadata)
<< attrTagS(_WindowsMetadataFile, tool.GenerateWindowsMetadata == _True ? tool.WindowsMetadataFile : QString())
diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp
index 219b889706..f219130e18 100644
--- a/qmake/generators/win32/msvc_objectmodel.cpp
+++ b/qmake/generators/win32/msvc_objectmodel.cpp
@@ -1454,8 +1454,10 @@ bool VCLinkerTool::parseOption(const char* option)
}else
EnableUAC = _True;
break;
- case 0x3389797: // /DEBUG
+ case 0x3389797: // /DEBUG[:FASTLINK]
GenerateDebugInformation = _True;
+ if (config->CompilerVersion >= NET2015 && strcmp(option + 7, "FASTLINK") == 0)
+ DebugInfoOption = linkerDebugOptionFastLink;
break;
case 0x0033896: // /DEF:filename
ModuleDefinitionFile = option+5;
diff --git a/qmake/generators/win32/msvc_objectmodel.h b/qmake/generators/win32/msvc_objectmodel.h
index 64c6e9098d..35bc3913a8 100644
--- a/qmake/generators/win32/msvc_objectmodel.h
+++ b/qmake/generators/win32/msvc_objectmodel.h
@@ -278,6 +278,10 @@ enum inlineExpansionOption {
expandAnySuitable,
expandDefault // Not useful number, but stops the output
};
+enum linkerDebugOption {
+ linkerDebugOptionNone,
+ linkerDebugOptionFastLink
+};
enum linkIncrementalType {
linkIncrementalDefault,
linkIncrementalNo,
@@ -591,6 +595,7 @@ public:
QStringList ForceSymbolReferences;
QString FunctionOrder;
triState GenerateDebugInformation;
+ linkerDebugOption DebugInfoOption;
triState GenerateMapFile;
qlonglong HeapCommitSize;
qlonglong HeapReserveSize;
diff --git a/qmake/library/qmakebuiltins.cpp b/qmake/library/qmakebuiltins.cpp
index 544ccac6d2..02c910fe46 100644
--- a/qmake/library/qmakebuiltins.cpp
+++ b/qmake/library/qmakebuiltins.cpp
@@ -396,14 +396,47 @@ static void addJsonValue(const QJsonValue &value, const QString &keyPrefix, ProV
}
}
+struct ErrorPosition {
+ int line;
+ int column;
+};
+
+static ErrorPosition calculateErrorPosition(const QByteArray &json, int offset)
+{
+ ErrorPosition pos = { 0, 0 };
+ offset--; // offset is 1-based, switching to 0-based
+ for (int i = 0; i < offset; ++i) {
+ switch (json.at(i)) {
+ case '\n':
+ pos.line++;
+ pos.column = 0;
+ break;
+ case '\r':
+ break;
+ case '\t':
+ pos.column = (pos.column + 8) & ~7;
+ break;
+ default:
+ pos.column++;
+ break;
+ }
+ }
+ // Lines and columns in text editors are 1-based:
+ pos.line++;
+ pos.column++;
+ return pos;
+}
+
QMakeEvaluator::VisitReturn QMakeEvaluator::parseJsonInto(const QByteArray &json, const QString &into, ProValueMap *value)
{
QJsonParseError error;
QJsonDocument document = QJsonDocument::fromJson(json, &error);
if (document.isNull()) {
- if (error.error != QJsonParseError::NoError)
- evalError(fL1S("Error parsing json at offset %1: %2")
- .arg(error.offset).arg(error.errorString()));
+ if (error.error != QJsonParseError::NoError) {
+ ErrorPosition errorPos = calculateErrorPosition(json, error.offset);
+ evalError(fL1S("Error parsing JSON at %1:%2: %3")
+ .arg(errorPos.line).arg(errorPos.column).arg(error.errorString()));
+ }
return QMakeEvaluator::ReturnFalse;
}
@@ -545,8 +578,7 @@ ProStringList QMakeEvaluator::evaluateBuiltinExpand(
int end = -1;
if (func_t == E_SECTION) {
if (args.count() != 3 && args.count() != 4) {
- evalError(fL1S("%1(var) section(var, sep, begin, end) requires"
- " three or four arguments.").arg(func.toQString(m_tmp1)));
+ evalError(fL1S("section(var, sep, begin, end) requires three or four arguments."));
} else {
var = args[0];
sep = args.at(1).toQString();
@@ -1058,16 +1090,22 @@ ProStringList QMakeEvaluator::evaluateBuiltinExpand(
break;
#ifdef PROEVALUATOR_FULL
case E_PROMPT: {
- if (args.count() != 1) {
- evalError(fL1S("prompt(question) requires one argument."));
+ if (args.count() != 1 && args.count() != 2) {
+ evalError(fL1S("prompt(question, [decorate=true]) requires one or two arguments."));
// } else if (currentFileName() == QLatin1String("-")) {
// evalError(fL1S("prompt(question) cannot be used when '-o -' is used"));
} else {
QString msg = m_option->expandEnvVars(args.at(0).toQString(m_tmp1));
- if (!msg.endsWith(QLatin1Char('?')))
- msg += QLatin1Char('?');
- fprintf(stderr, "Project PROMPT: %s ", qPrintable(msg));
-
+ bool decorate = true;
+ if (args.count() == 2)
+ decorate = isTrue(args.at(1));
+ if (decorate) {
+ if (!msg.endsWith(QLatin1Char('?')))
+ msg += QLatin1Char('?');
+ fprintf(stderr, "Project PROMPT: %s ", qPrintable(msg));
+ } else {
+ fputs(qPrintable(msg), stderr);
+ }
QFile qfile;
if (qfile.open(stdin, QIODevice::ReadOnly)) {
QTextStream t(&qfile);
@@ -1326,7 +1364,23 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
}
++vit;
}
+ for (auto fit = m_functionDefs.testFunctions.begin(); fit != m_functionDefs.testFunctions.end(); ) {
+ if (fit->pro() == pro)
+ fit = m_functionDefs.testFunctions.erase(fit);
+ else
+ ++fit;
+ }
+ for (auto fit = m_functionDefs.replaceFunctions.begin(); fit != m_functionDefs.replaceFunctions.end(); ) {
+ if (fit->pro() == pro)
+ fit = m_functionDefs.replaceFunctions.erase(fit);
+ else
+ ++fit;
+ }
pro->deref();
+ ProStringList &iif = m_valuemapStack.first()[ProKey("QMAKE_INTERNAL_INCLUDED_FILES")];
+ int idx = iif.indexOf(ProString(fn));
+ if (idx >= 0)
+ iif.removeAt(idx);
return ReturnTrue;
}
case T_INFILE:
diff --git a/qmake/option.cpp b/qmake/option.cpp
index 52bd10bfee..fb49f5a100 100644
--- a/qmake/option.cpp
+++ b/qmake/option.cpp
@@ -313,6 +313,10 @@ Option::init(int argc, char **argv)
if(argc && argv) {
QString argv0 = argv[0];
+#ifdef Q_OS_WIN
+ if (!argv0.endsWith(QLatin1String(".exe"), Qt::CaseInsensitive))
+ argv0 += QLatin1String(".exe");
+#endif
if(Option::qmake_mode == Option::QMAKE_GENERATE_NOTHING)
Option::qmake_mode = default_mode(argv0);
if(!argv0.isEmpty() && !QFileInfo(argv0).isRelative()) {
@@ -336,10 +340,6 @@ Option::init(int argc, char **argv)
if ((*p).isEmpty())
continue;
QString candidate = currentDir.absoluteFilePath(*p + QLatin1Char('/') + argv0);
-#ifdef Q_OS_WIN
- if (!candidate.endsWith(QLatin1String(".exe")))
- candidate += QLatin1String(".exe");
-#endif
if (QFile::exists(candidate)) {
globals->qmake_abslocation = candidate;
break;
diff --git a/qmake/option.h b/qmake/option.h
index 8b9e2f1027..eaa3706b24 100644
--- a/qmake/option.h
+++ b/qmake/option.h
@@ -40,7 +40,7 @@
QT_BEGIN_NAMESPACE
-#define QMAKE_VERSION_STR "3.0"
+#define QMAKE_VERSION_STR "3.1"
QString qmake_getpwd();
bool qmake_setpwd(const QString &p);
diff --git a/qmake/property.cpp b/qmake/property.cpp
index 9ee08f4b55..d17d62481a 100644
--- a/qmake/property.cpp
+++ b/qmake/property.cpp
@@ -41,38 +41,41 @@ static const struct {
const char *name;
QLibraryInfo::LibraryLocation loc;
bool raw;
+ bool singular;
} propList[] = {
- { "QT_SYSROOT", QLibraryInfo::SysrootPath, true },
- { "QT_INSTALL_PREFIX", QLibraryInfo::PrefixPath, false },
- { "QT_INSTALL_ARCHDATA", QLibraryInfo::ArchDataPath, false },
- { "QT_INSTALL_DATA", QLibraryInfo::DataPath, false },
- { "QT_INSTALL_DOCS", QLibraryInfo::DocumentationPath, false },
- { "QT_INSTALL_HEADERS", QLibraryInfo::HeadersPath, false },
- { "QT_INSTALL_LIBS", QLibraryInfo::LibrariesPath, false },
- { "QT_INSTALL_LIBEXECS", QLibraryInfo::LibraryExecutablesPath, false },
- { "QT_INSTALL_BINS", QLibraryInfo::BinariesPath, false },
- { "QT_INSTALL_TESTS", QLibraryInfo::TestsPath, false },
- { "QT_INSTALL_PLUGINS", QLibraryInfo::PluginsPath, false },
- { "QT_INSTALL_IMPORTS", QLibraryInfo::ImportsPath, false },
- { "QT_INSTALL_QML", QLibraryInfo::Qml2ImportsPath, false },
- { "QT_INSTALL_TRANSLATIONS", QLibraryInfo::TranslationsPath, false },
- { "QT_INSTALL_CONFIGURATION", QLibraryInfo::SettingsPath, false },
- { "QT_INSTALL_EXAMPLES", QLibraryInfo::ExamplesPath, false },
- { "QT_INSTALL_DEMOS", QLibraryInfo::ExamplesPath, false }, // Just backwards compat
- { "QT_HOST_PREFIX", QLibraryInfo::HostPrefixPath, true },
- { "QT_HOST_DATA", QLibraryInfo::HostDataPath, true },
- { "QT_HOST_BINS", QLibraryInfo::HostBinariesPath, true },
- { "QT_HOST_LIBS", QLibraryInfo::HostLibrariesPath, true },
- { "QMAKE_SPEC", QLibraryInfo::HostSpecPath, true },
- { "QMAKE_XSPEC", QLibraryInfo::TargetSpecPath, true },
+ { "QT_SYSROOT", QLibraryInfo::SysrootPath, true, true },
+ { "QT_INSTALL_PREFIX", QLibraryInfo::PrefixPath, false, false },
+ { "QT_INSTALL_ARCHDATA", QLibraryInfo::ArchDataPath, false, false },
+ { "QT_INSTALL_DATA", QLibraryInfo::DataPath, false, false },
+ { "QT_INSTALL_DOCS", QLibraryInfo::DocumentationPath, false, false },
+ { "QT_INSTALL_HEADERS", QLibraryInfo::HeadersPath, false, false },
+ { "QT_INSTALL_LIBS", QLibraryInfo::LibrariesPath, false, false },
+ { "QT_INSTALL_LIBEXECS", QLibraryInfo::LibraryExecutablesPath, false, false },
+ { "QT_INSTALL_BINS", QLibraryInfo::BinariesPath, false, false },
+ { "QT_INSTALL_TESTS", QLibraryInfo::TestsPath, false, false },
+ { "QT_INSTALL_PLUGINS", QLibraryInfo::PluginsPath, false, false },
+ { "QT_INSTALL_IMPORTS", QLibraryInfo::ImportsPath, false, false },
+ { "QT_INSTALL_QML", QLibraryInfo::Qml2ImportsPath, false, false },
+ { "QT_INSTALL_TRANSLATIONS", QLibraryInfo::TranslationsPath, false, false },
+ { "QT_INSTALL_CONFIGURATION", QLibraryInfo::SettingsPath, false, false },
+ { "QT_INSTALL_EXAMPLES", QLibraryInfo::ExamplesPath, false, false },
+ { "QT_INSTALL_DEMOS", QLibraryInfo::ExamplesPath, false, false }, // Just backwards compat
+ { "QT_HOST_PREFIX", QLibraryInfo::HostPrefixPath, true, false },
+ { "QT_HOST_DATA", QLibraryInfo::HostDataPath, true, false },
+ { "QT_HOST_BINS", QLibraryInfo::HostBinariesPath, true, false },
+ { "QT_HOST_LIBS", QLibraryInfo::HostLibrariesPath, true, false },
+ { "QMAKE_SPEC", QLibraryInfo::HostSpecPath, true, true },
+ { "QMAKE_XSPEC", QLibraryInfo::TargetSpecPath, true, true },
};
QMakeProperty::QMakeProperty() : settings(0)
{
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);
+ if (!propList[i].singular) {
+ m_values[ProKey(name + "/src")] = QLibraryInfo::rawLocation(propList[i].loc, QLibraryInfo::EffectiveSourcePaths);
+ m_values[ProKey(name + "/get")] = QLibraryInfo::rawLocation(propList[i].loc, QLibraryInfo::EffectivePaths);
+ }
QString val = QLibraryInfo::rawLocation(propList[i].loc, QLibraryInfo::FinalPaths);
if (!propList[i].raw) {
m_values[ProKey(name + "/dev")] = QLibraryInfo::rawLocation(propList[i].loc, QLibraryInfo::DevicePaths);