summaryrefslogtreecommitdiffstats
path: root/qmake
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@theqtcompany.com>2016-01-08 12:30:57 +0100
committerFrederik Gladhorn <frederik.gladhorn@theqtcompany.com>2016-01-08 12:35:24 +0100
commitad16478a76815f8f61d454bf7760aaf9ffbb4b51 (patch)
treeeefdd9219cc9d59b62e042f49fc7555b980cb7a4 /qmake
parent80a741f3616290897ba0d9f1cbd3c9c5ee62da37 (diff)
parent09c92863001790a0304a5ef389901ee2b5b6cdc2 (diff)
Merge remote-tracking branch 'origin/5.6' into dev
Based on merge done by Liang Qi Change-Id: Id566e5b9f284d29bff2199f13f9417c660f5b26f
Diffstat (limited to 'qmake')
-rw-r--r--qmake/generators/win32/msbuild_objectmodel.cpp2
-rw-r--r--qmake/generators/win32/msvc_objectmodel.cpp4
-rw-r--r--qmake/generators/win32/msvc_vcproj.cpp4
-rw-r--r--qmake/library/qmakebuiltins.cpp35
-rw-r--r--qmake/library/qmakeevaluator.cpp2
-rw-r--r--qmake/library/qmakeevaluator.h9
-rw-r--r--qmake/library/qmakeparser.h5
-rw-r--r--qmake/library/qmakevfs.cpp17
-rw-r--r--qmake/library/qmakevfs.h2
-rw-r--r--qmake/option.cpp3
-rw-r--r--qmake/option.h2
11 files changed, 56 insertions, 29 deletions
diff --git a/qmake/generators/win32/msbuild_objectmodel.cpp b/qmake/generators/win32/msbuild_objectmodel.cpp
index aad6e6e878..8e2be589cd 100644
--- a/qmake/generators/win32/msbuild_objectmodel.cpp
+++ b/qmake/generators/win32/msbuild_objectmodel.cpp
@@ -628,7 +628,7 @@ void VCXProjectWriter::write(XmlOutput &xml, VCProject &tool)
<< tagValue("Platform", tool.SingleProjects.at(i).PlatformName)
<< closetag();
isWinRT = isWinRT || tool.SingleProjects.at(i).Configuration.WinRT;
- isWinPhone = isWinPhone = tool.SingleProjects.at(i).Configuration.WinPhone;
+ isWinPhone = isWinPhone || tool.SingleProjects.at(i).Configuration.WinPhone;
}
xml << closetag()
diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp
index 339dae953a..18457ac5ad 100644
--- a/qmake/generators/win32/msvc_objectmodel.cpp
+++ b/qmake/generators/win32/msvc_objectmodel.cpp
@@ -2399,11 +2399,7 @@ bool VCFilter::addExtraCompiler(const VCFilterFile &info)
if (!CustomBuildTool.Description.isEmpty())
CustomBuildTool.Description += ", ";
CustomBuildTool.Description += cmd_name;
- // Execute custom build steps in an environment variable scope to prevent unwanted
- // side effects for downstream build steps
- CustomBuildTool.CommandLine += QLatin1String("setlocal");
CustomBuildTool.CommandLine += VCToolBase::fixCommandLine(cmd.trimmed());
- CustomBuildTool.CommandLine += QLatin1String("endlocal");
int space = cmd.indexOf(' ');
QFileInfo finf(cmd.left(space));
if (CustomBuildTool.ToolPath.isEmpty())
diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp
index 1e187075c8..465c8fc312 100644
--- a/qmake/generators/win32/msvc_vcproj.cpp
+++ b/qmake/generators/win32/msvc_vcproj.cpp
@@ -1428,11 +1428,11 @@ void VcprojGenerator::initWinDeployQtTool()
// itself contains the original subdirectories as parameters and hence the
// call fails.
// Neither there is a way to disable this behavior for Windows Phone, nor
- // to influence the parameters. Hence the only way to get a release build
+ // to influence the parameters. Hence the only way to get a build
// done is to recreate the directory structure manually by invoking
// windeployqt a second time, so that the MDILXapCompile call succeeds and
// deployment continues.
- if (conf.WinPhone && conf.Name == QStringLiteral("Release|ARM")) {
+ if (conf.WinPhone) {
conf.windeployqt.CommandLine = commandLine
+ QStringLiteral(" -list relative -dir \"$(MSBuildProjectDirectory)\\")
+ var("OBJECTS_DIR")
diff --git a/qmake/library/qmakebuiltins.cpp b/qmake/library/qmakebuiltins.cpp
index f57d9c89a7..02cd8a2760 100644
--- a/qmake/library/qmakebuiltins.cpp
+++ b/qmake/library/qmakebuiltins.cpp
@@ -358,10 +358,10 @@ static QMakeEvaluator::VisitReturn parseJsonInto(const QByteArray &json, const Q
QMakeEvaluator::VisitReturn
QMakeEvaluator::writeFile(const QString &ctx, const QString &fn, QIODevice::OpenMode mode,
- const QString &contents)
+ bool exe, const QString &contents)
{
QString errStr;
- if (!m_vfs->writeFile(fn, mode, contents, &errStr)) {
+ if (!m_vfs->writeFile(fn, mode, exe, contents, &errStr)) {
evalError(fL1S("Cannot write %1file %2: %3")
.arg(ctx, QDir::toNativeSeparators(fn), errStr));
return ReturnFalse;
@@ -1470,8 +1470,12 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
fputs(msg.toLatin1().constData(), stderr);
#endif
} else {
- m_handler->fileMessage(fL1S("Project %1: %2")
- .arg(function.toQString(m_tmp1).toUpper(), msg));
+ m_handler->fileMessage(
+ (func_t == T_ERROR ? QMakeHandler::ErrorMessage :
+ func_t == T_WARNING ? QMakeHandler::WarningMessage :
+ QMakeHandler::InfoMessage)
+ | (m_cumulative ? QMakeHandler::CumulativeEvalMessage : 0),
+ fL1S("Project %1: %2").arg(function.toQString(m_tmp1).toUpper(), msg));
}
}
return (func_t == T_ERROR && !m_cumulative) ? ReturnError : ReturnTrue;
@@ -1543,22 +1547,33 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
}
case T_WRITE_FILE: {
if (args.count() > 3) {
- evalError(fL1S("write_file(name, [content var, [append]]) requires one to three arguments."));
+ evalError(fL1S("write_file(name, [content var, [append] [exe]]) requires one to three arguments."));
return ReturnFalse;
}
QIODevice::OpenMode mode = QIODevice::Truncate;
+ bool exe = false;
QString contents;
if (args.count() >= 2) {
const ProStringList &vals = values(args.at(1).toKey());
if (!vals.isEmpty())
contents = vals.join(QLatin1Char('\n')) + QLatin1Char('\n');
- if (args.count() >= 3)
- if (!args.at(2).toQString(m_tmp1).compare(fL1S("append"), Qt::CaseInsensitive))
- mode = QIODevice::Append;
+ if (args.count() >= 3) {
+ foreach (const ProString &opt, split_value_list(args.at(2).toQString(m_tmp2))) {
+ opt.toQString(m_tmp3);
+ if (m_tmp3 == QLatin1String("append")) {
+ mode = QIODevice::Append;
+ } else if (m_tmp3 == QLatin1String("exe")) {
+ exe = true;
+ } else {
+ evalError(fL1S("write_file(): invalid flag %1.").arg(m_tmp3));
+ return ReturnFalse;
+ }
+ }
+ }
}
QString path = resolvePath(args.at(0).toQString(m_tmp1));
path.detach(); // make sure to not leak m_tmp1 into the map of written files.
- return writeFile(QString(), path, mode, contents);
+ return writeFile(QString(), path, mode, exe, contents);
}
case T_TOUCH: {
if (args.count() != 2) {
@@ -1769,7 +1784,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
valuesRef(ProKey("_QMAKE_STASH_")) << ProString(fn);
}
}
- return writeFile(fL1S("cache "), fn, QIODevice::Append, varstr);
+ return writeFile(fL1S("cache "), fn, QIODevice::Append, false, varstr);
}
default:
evalError(fL1S("Function '%1' is not implemented.").arg(function.toQString(m_tmp1)));
diff --git a/qmake/library/qmakeevaluator.cpp b/qmake/library/qmakeevaluator.cpp
index d7fba6b227..0c4ba74955 100644
--- a/qmake/library/qmakeevaluator.cpp
+++ b/qmake/library/qmakeevaluator.cpp
@@ -1308,7 +1308,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateConfigFeatures()
config.detach();
processed.insert(config);
VisitReturn vr = evaluateFeatureFile(config, true);
- if (vr == ReturnError)
+ if (vr == ReturnError && !m_cumulative)
return vr;
if (vr == ReturnTrue) {
finished = false;
diff --git a/qmake/library/qmakeevaluator.h b/qmake/library/qmakeevaluator.h
index 8995d49582..9560f71587 100644
--- a/qmake/library/qmakeevaluator.h
+++ b/qmake/library/qmakeevaluator.h
@@ -41,7 +41,6 @@
#include "qmakeparser.h"
#include "ioutils.h"
-#include <qiodevice.h>
#include <qlist.h>
#include <qlinkedlist.h>
#include <qmap.h>
@@ -52,6 +51,8 @@
#include <qshareddata.h>
#ifndef QT_BOOTSTRAPPED
# include <qprocess.h>
+#else
+# include <qiodevice.h>
#endif
#ifdef PROEVALUATOR_THREAD_SAFE
# include <qmutex.h>
@@ -67,6 +68,8 @@ public:
enum {
SourceEvaluator = 0x10,
+ CumulativeEvalMessage = 0x1000,
+
EvalWarnLanguage = SourceEvaluator | WarningMessage | WarnLanguage,
EvalWarnDeprecated = SourceEvaluator | WarningMessage | WarnDeprecated,
@@ -74,7 +77,7 @@ public:
};
// error(), warning() and message() from .pro file
- virtual void fileMessage(const QString &msg) = 0;
+ virtual void fileMessage(int type, const QString &msg) = 0;
enum EvalFileType { EvalProjectFile, EvalIncludeFile, EvalConfigFile, EvalFeatureFile, EvalAuxFile };
virtual void aboutToEval(ProFile *parent, ProFile *proFile, EvalFileType type) = 0;
@@ -235,7 +238,7 @@ public:
QMultiMap<int, ProString> &rootSet) const;
VisitReturn writeFile(const QString &ctx, const QString &fn, QIODevice::OpenMode mode,
- const QString &contents);
+ bool exe, const QString &contents);
#ifndef QT_BOOTSTRAPPED
void runProcess(QProcess *proc, const QString &command) const;
#endif
diff --git a/qmake/library/qmakeparser.h b/qmake/library/qmakeparser.h
index dfea1ddfdf..7fa4f62a96 100644
--- a/qmake/library/qmakeparser.h
+++ b/qmake/library/qmakeparser.h
@@ -50,8 +50,9 @@ class QMAKE_EXPORT QMakeParserHandler
public:
enum {
CategoryMask = 0xf00,
- WarningMessage = 0x000,
- ErrorMessage = 0x100,
+ InfoMessage = 0x100,
+ WarningMessage = 0x200,
+ ErrorMessage = 0x300,
SourceMask = 0xf0,
SourceParser = 0,
diff --git a/qmake/library/qmakevfs.cpp b/qmake/library/qmakevfs.cpp
index 613e4e90d7..d23d1f06ff 100644
--- a/qmake/library/qmakevfs.cpp
+++ b/qmake/library/qmakevfs.cpp
@@ -52,8 +52,8 @@ QMakeVfs::QMakeVfs()
{
}
-bool QMakeVfs::writeFile(const QString &fn, QIODevice::OpenMode mode, const QString &contents,
- QString *errStr)
+bool QMakeVfs::writeFile(const QString &fn, QIODevice::OpenMode mode, bool exe,
+ const QString &contents, QString *errStr)
{
#ifndef PROEVALUATOR_FULL
# ifdef PROEVALUATOR_THREAD_SAFE
@@ -75,8 +75,16 @@ bool QMakeVfs::writeFile(const QString &fn, QIODevice::OpenMode mode, const QStr
QByteArray bytes = contents.toLocal8Bit();
QFile cfile(fn);
if (!(mode & QIODevice::Append) && cfile.open(QIODevice::ReadOnly | QIODevice::Text)) {
- if (cfile.readAll() == bytes)
+ if (cfile.readAll() == bytes) {
+ if (exe) {
+ cfile.setPermissions(cfile.permissions()
+ | QFile::ExeUser | QFile::ExeGroup | QFile::ExeOther);
+ } else {
+ cfile.setPermissions(cfile.permissions()
+ & ~(QFile::ExeUser | QFile::ExeGroup | QFile::ExeOther));
+ }
return true;
+ }
cfile.close();
}
if (!cfile.open(mode | QIODevice::WriteOnly | QIODevice::Text)) {
@@ -89,6 +97,9 @@ bool QMakeVfs::writeFile(const QString &fn, QIODevice::OpenMode mode, const QStr
*errStr = cfile.errorString();
return false;
}
+ if (exe)
+ cfile.setPermissions(cfile.permissions()
+ | QFile::ExeUser | QFile::ExeGroup | QFile::ExeOther);
return true;
#endif
}
diff --git a/qmake/library/qmakevfs.h b/qmake/library/qmakevfs.h
index 8eeae15dcc..1bc11d3593 100644
--- a/qmake/library/qmakevfs.h
+++ b/qmake/library/qmakevfs.h
@@ -52,7 +52,7 @@ class QMAKE_EXPORT QMakeVfs
public:
QMakeVfs();
- bool writeFile(const QString &fn, QIODevice::OpenMode mode, const QString &contents, QString *errStr);
+ bool writeFile(const QString &fn, QIODevice::OpenMode mode, bool exe, const QString &contents, QString *errStr);
bool readFile(const QString &fn, QString *contents, QString *errStr);
bool exists(const QString &fn);
diff --git a/qmake/option.cpp b/qmake/option.cpp
index 1d1aece626..3c9b672be9 100644
--- a/qmake/option.cpp
+++ b/qmake/option.cpp
@@ -602,8 +602,9 @@ void EvalHandler::message(int type, const QString &msg, const QString &fileName,
fprintf(stderr, "%s%s\n", qPrintable(pfx), qPrintable(msg));
}
-void EvalHandler::fileMessage(const QString &msg)
+void EvalHandler::fileMessage(int type, const QString &msg)
{
+ Q_UNUSED(type)
fprintf(stderr, "%s\n", qPrintable(msg));
}
diff --git a/qmake/option.h b/qmake/option.h
index 663f096072..cb3eb1341a 100644
--- a/qmake/option.h
+++ b/qmake/option.h
@@ -67,7 +67,7 @@ class EvalHandler : public QMakeHandler {
public:
void message(int type, const QString &msg, const QString &fileName, int lineNo);
- void fileMessage(const QString &msg);
+ void fileMessage(int type, const QString &msg);
void aboutToEval(ProFile *, ProFile *, EvalFileType);
void doneWithEval(ProFile *);