summaryrefslogtreecommitdiffstats
path: root/qmake
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2013-02-13 11:58:07 +0100
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2013-02-14 14:24:57 +0100
commite65cd6f3794e12e6bc5c2ee985eae8e70ff5f333 (patch)
tree8965835c375422d63b2ccfa927b31a56e64bda1d /qmake
parentd1ee7189553e13337b198fe4ba66d79fb7a7f41d (diff)
parente95a758236cf2c68e33da4ddb62bff4fe8d9dd8b (diff)
Merge remote-tracking branch 'origin/stable' into dev
Conflicts: src/concurrent/doc/qtconcurrent.qdocconf src/corelib/doc/qtcore.qdocconf src/corelib/global/qglobal.h src/dbus/doc/qtdbus.qdocconf src/dbus/qdbusmessage.h src/gui/doc/qtgui.qdocconf src/gui/image/qimagereader.cpp src/network/doc/qtnetwork.qdocconf src/opengl/doc/qtopengl.qdocconf src/opengl/qgl.h src/plugins/platforms/windows/qwindowswindow.cpp src/printsupport/doc/qtprintsupport.qdocconf src/sql/doc/qtsql.qdocconf src/testlib/doc/qttestlib.qdocconf src/tools/qdoc/doc/config/qt-cpp-ignore.qdocconf src/widgets/doc/qtwidgets.qdocconf src/xml/doc/qtxml.qdocconf Change-Id: Ie9a1fa2cc44bec22a0b942e817a1095ca3414629
Diffstat (limited to 'qmake')
-rw-r--r--qmake/generators/makefile.cpp21
-rw-r--r--qmake/generators/win32/msvc_objectmodel.cpp21
-rw-r--r--qmake/generators/win32/winmakefile.cpp2
-rw-r--r--qmake/library/qmakebuiltins.cpp26
-rw-r--r--qmake/library/qmakeevaluator.h2
-rw-r--r--qmake/library/qmakeglobals.cpp23
-rw-r--r--qmake/library/qmakeglobals.h2
-rw-r--r--qmake/library/qmakeparser.cpp7
-rw-r--r--qmake/option.cpp13
-rw-r--r--qmake/option.h2
-rw-r--r--qmake/property.cpp16
11 files changed, 69 insertions, 66 deletions
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index 444556d467..b001fd930b 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -3110,15 +3110,18 @@ MakefileGenerator::openOutput(QFile &file, const QString &build) const
QString
MakefileGenerator::pkgConfigFileName(bool fixify)
{
- QString ret = var("TARGET");
- int slsh = ret.lastIndexOf(Option::dir_sep);
- if(slsh != -1)
- ret = ret.right(ret.length() - slsh - 1);
- if(ret.startsWith("lib"))
- ret = ret.mid(3);
- int dot = ret.indexOf('.');
- if(dot != -1)
- ret = ret.left(dot);
+ QString ret = project->first("QMAKE_PKGCONFIG_FILE").toQString();
+ if (ret.isEmpty()) {
+ ret = project->first("TARGET").toQString();
+ int slsh = ret.lastIndexOf(Option::dir_sep);
+ if (slsh != -1)
+ ret = ret.right(ret.length() - slsh - 1);
+ if (ret.startsWith("lib"))
+ ret = ret.mid(3);
+ int dot = ret.indexOf('.');
+ if (dot != -1)
+ ret = ret.left(dot);
+ }
ret += Option::pkgcfg_ext;
QString subdir = project->first("QMAKE_PKGCONFIG_DESTDIR").toQString();
if(!subdir.isEmpty()) {
diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp
index f7b0b29def..2a9e657304 100644
--- a/qmake/generators/win32/msvc_objectmodel.cpp
+++ b/qmake/generators/win32/msvc_objectmodel.cpp
@@ -311,7 +311,7 @@ VCCLCompilerTool::VCCLCompilerTool()
: AssemblerOutput(asmListingNone),
BasicRuntimeChecks(runtimeBasicCheckNone),
BrowseInformation(brInfoNone),
- BufferSecurityCheck(_False),
+ BufferSecurityCheck(unset),
CallingConvention(callConventionDefault),
CompileAs(compileAsDefault),
CompileAsManaged(managedDefault),
@@ -603,9 +603,7 @@ bool VCCLCompilerTool::parseOption(const char* option)
CallingConvention = callConventionFastCall;
break;
case 's':
- // Warning: following [num] is not used,
- // were should we put it?
- BufferSecurityCheck = _True;
+ AdditionalOptions += option;
break;
case 'y':
EnableFunctionLevelLinking = _True;
@@ -1080,11 +1078,20 @@ bool VCCLCompilerTool::parseOption(const char* option)
}
found = false; break;
case 'o':
- if (second == 'p' && third == 'e' && fourth == 'n') {
- OpenMP = _True;
- break;
+ {
+ const char *str = option + 2;
+ const size_t len = strlen(str);
+ if (len >= 5 && len <= 6 && strncmp(str, "penmp", 5) == 0) {
+ if (len == 5) {
+ OpenMP = _True;
+ break;
+ } else if (str[5] == '-') {
+ OpenMP = _False;
+ break;
+ }
}
found = false; break;
+ }
case 's':
if(second == 'h' && third == 'o' && fourth == 'w') {
ShowIncludes = _True;
diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp
index 3831e08ed4..cac63ed932 100644
--- a/qmake/generators/win32/winmakefile.cpp
+++ b/qmake/generators/win32/winmakefile.cpp
@@ -834,7 +834,7 @@ QString Win32MakefileGenerator::defaultInstall(const QString &t)
if(slsh != -1)
dst_prl = dst_prl.right(dst_prl.length() - slsh - 1);
dst_prl = filePrefixRoot(root, targetdir + dst_prl);
- ret += "-$(INSTALL_FILE) \"" + project->first("QMAKE_INTERNAL_PRL_FILE") + "\" \"" + dst_prl + "\"";
+ ret += installMetaFile(ProKey("QMAKE_PRL_INSTALL_REPLACE"), project->first("QMAKE_INTERNAL_PRL_FILE").toQString(), dst_prl);
if(!uninst.isEmpty())
uninst.append("\n\t");
uninst.append("-$(DEL_FILE) \"" + dst_prl + "\"");
diff --git a/qmake/library/qmakebuiltins.cpp b/qmake/library/qmakebuiltins.cpp
index 2ade267f74..f46d66ba89 100644
--- a/qmake/library/qmakebuiltins.cpp
+++ b/qmake/library/qmakebuiltins.cpp
@@ -382,14 +382,16 @@ QByteArray QMakeEvaluator::getCommandOutput(const QString &args) const
}
void QMakeEvaluator::populateDeps(
- const ProStringList &deps, const ProString &prefix,
+ const ProStringList &deps, const ProString &prefix, const ProStringList &suffixes,
QHash<ProKey, QSet<ProKey> > &dependencies, ProValueMap &dependees,
ProStringList &rootSet) const
{
foreach (const ProString &item, deps)
if (!dependencies.contains(item.toKey())) {
QSet<ProKey> &dset = dependencies[item.toKey()]; // Always create entry
- ProStringList depends = values(ProKey(prefix + item + QString::fromLatin1(".depends")));
+ ProStringList depends;
+ foreach (const ProString &suffix, suffixes)
+ depends += values(ProKey(prefix + item + suffix));
if (depends.isEmpty()) {
rootSet << item;
} else {
@@ -397,7 +399,7 @@ void QMakeEvaluator::populateDeps(
dset.insert(dep.toKey());
dependees[dep.toKey()] << item;
}
- populateDeps(depends, prefix, dependencies, dependees, rootSet);
+ populateDeps(depends, prefix, suffixes, dependencies, dependees, rootSet);
}
}
}
@@ -692,11 +694,10 @@ ProStringList QMakeEvaluator::evaluateBuiltinExpand(
}
break;
case E_EVAL:
- if (args.count() != 1) {
+ if (args.count() != 1)
evalError(fL1S("eval(variable) requires one argument."));
- } else {
+ else
ret += values(map(args.at(0)));
- }
break;
case E_LIST: {
QString tmp;
@@ -913,14 +914,17 @@ ProStringList QMakeEvaluator::evaluateBuiltinExpand(
break;
case E_SORT_DEPENDS:
case E_RESOLVE_DEPENDS:
- if (args.count() < 1 || args.count() > 2) {
- evalError(fL1S("%1(var, prefix) requires one or two arguments.").arg(func.toQString(m_tmp1)));
+ if (args.count() < 1 || args.count() > 3) {
+ evalError(fL1S("%1(var, [prefix, [suffixes]]) requires one to three arguments.")
+ .arg(func.toQString(m_tmp1)));
} else {
QHash<ProKey, QSet<ProKey> > dependencies;
ProValueMap dependees;
ProStringList rootSet;
ProStringList orgList = values(args.at(0).toKey());
populateDeps(orgList, (args.count() < 2 ? ProString() : args.at(1)),
+ args.count() < 3 ? ProStringList(ProString(".depends"))
+ : split_value_list(args.at(2).toQString(m_tmp2)),
dependencies, dependees, rootSet);
for (int i = 0; i < rootSet.size(); ++i) {
const ProString &item = rootSet.at(i);
@@ -1155,9 +1159,8 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
for (int i = configs.size() - 1; i >= 0; i--) {
for (int mut = 0; mut < mutuals.count(); mut++) {
- if (configs[i] == mutuals[mut].trimmed()) {
+ if (configs[i] == mutuals[mut].trimmed())
return returnBool(configs[i] == args[0]);
- }
}
}
return ReturnFalse;
@@ -1421,9 +1424,8 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
}
const QString &file = resolvePath(m_option->expandEnvVars(args.at(0).toQString(m_tmp1)));
- if (IoUtils::exists(file)) {
+ if (IoUtils::exists(file))
return ReturnTrue;
- }
int slsh = file.lastIndexOf(QLatin1Char('/'));
QString fn = file.mid(slsh+1);
if (fn.contains(QLatin1Char('*')) || fn.contains(QLatin1Char('?'))) {
diff --git a/qmake/library/qmakeevaluator.h b/qmake/library/qmakeevaluator.h
index ec36fdac39..4565a2cc15 100644
--- a/qmake/library/qmakeevaluator.h
+++ b/qmake/library/qmakeevaluator.h
@@ -219,7 +219,7 @@ public:
bool isActiveConfig(const QString &config, bool regex = false);
void populateDeps(
- const ProStringList &deps, const ProString &prefix,
+ const ProStringList &deps, const ProString &prefix, const ProStringList &suffixes,
QHash<ProKey, QSet<ProKey> > &dependencies,
ProValueMap &dependees, ProStringList &rootSet) const;
diff --git a/qmake/library/qmakeglobals.cpp b/qmake/library/qmakeglobals.cpp
index 7a907b7eed..ac9a0856ff 100644
--- a/qmake/library/qmakeglobals.cpp
+++ b/qmake/library/qmakeglobals.cpp
@@ -164,29 +164,28 @@ QMakeGlobals::ArgumentReturn QMakeGlobals::addCommandLineArguments(
break;
default:
if (arg.startsWith(QLatin1Char('-'))) {
- if (arg == QLatin1String("-after")) {
+ if (arg == QLatin1String("-after"))
state.after = true;
- } else if (arg == QLatin1String("-config")) {
+ else if (arg == QLatin1String("-config"))
argState = ArgConfig;
- } else if (arg == QLatin1String("-nocache")) {
+ else if (arg == QLatin1String("-nocache"))
do_cache = false;
- } else if (arg == QLatin1String("-cache")) {
+ else if (arg == QLatin1String("-cache"))
argState = ArgCache;
- } else if (arg == QLatin1String("-platform") || arg == QLatin1String("-spec")) {
+ else if (arg == QLatin1String("-platform") || arg == QLatin1String("-spec"))
argState = ArgSpec;
- } else if (arg == QLatin1String("-xplatform") || arg == QLatin1String("-xspec")) {
+ else if (arg == QLatin1String("-xplatform") || arg == QLatin1String("-xspec"))
argState = ArgXSpec;
- } else if (arg == QLatin1String("-template") || arg == QLatin1String("-t")) {
+ else if (arg == QLatin1String("-template") || arg == QLatin1String("-t"))
argState = ArgTmpl;
- } else if (arg == QLatin1String("-template_prefix") || arg == QLatin1String("-tp")) {
+ else if (arg == QLatin1String("-template_prefix") || arg == QLatin1String("-tp"))
argState = ArgTmplPfx;
- } else if (arg == QLatin1String("-win32")) {
+ else if (arg == QLatin1String("-win32"))
dir_sep = QLatin1Char('\\');
- } else if (arg == QLatin1String("-unix")) {
+ else if (arg == QLatin1String("-unix"))
dir_sep = QLatin1Char('/');
- } else {
+ else
return ArgumentUnknown;
- }
} else if (arg.contains(QLatin1Char('='))) {
if (state.after)
state.postcmds << arg;
diff --git a/qmake/library/qmakeglobals.h b/qmake/library/qmakeglobals.h
index 9f8893ec9c..efb4d28a63 100644
--- a/qmake/library/qmakeglobals.h
+++ b/qmake/library/qmakeglobals.h
@@ -99,6 +99,8 @@ public:
QString pwd;
QStringList precmds, preconfigs, postcmds, postconfigs;
bool after;
+
+ void flush() { after = false; }
};
class QMAKE_EXPORT QMakeGlobals
diff --git a/qmake/library/qmakeparser.cpp b/qmake/library/qmakeparser.cpp
index 6641149941..f32267cf59 100644
--- a/qmake/library/qmakeparser.cpp
+++ b/qmake/library/qmakeparser.cpp
@@ -239,7 +239,7 @@ bool QMakeParser::read(ProFile *pro)
}
QByteArray bcont = file.readAll();
- if (bcont.startsWith(QByteArray("\xef\xbb\xbf"))) {
+ if (bcont.startsWith("\xef\xbb\xbf")) {
// UTF-8 BOM will cause subtle errors
m_handler->message(QMakeParserHandler::ParserIoError,
fL1S("Unexpected UTF-8 BOM in %1").arg(pro->fileName()));
@@ -1147,11 +1147,10 @@ void QMakeParser::finalizeCall(ushort *&tokPtr, ushort *uc, ushort *ptr, int arg
uint nlen = uce[1];
if (uce[nlen + 2] == TokFuncTerminator) {
m_tmp.setRawData((QChar *)uce + 2, nlen);
- if (m_tmp == statics.strhost_build) {
+ if (m_tmp == statics.strhost_build)
m_proFile->setHostBuild(true);
- } else {
+ else
parseError(fL1S("Unknown option() %1.").arg(m_tmp));
- }
return;
}
}
diff --git a/qmake/option.cpp b/qmake/option.cpp
index 7d16949242..fdf11d9266 100644
--- a/qmake/option.cpp
+++ b/qmake/option.cpp
@@ -193,9 +193,8 @@ bool usage(const char *a0)
}
int
-Option::parseCommandLine(QStringList &args)
+Option::parseCommandLine(QStringList &args, QMakeCmdLineParserState &state)
{
- QMakeCmdLineParserState state(QDir::currentPath());
enum { ArgNone, ArgOutput } argState = ArgNone;
int x = 0;
while (x < args.count()) {
@@ -313,8 +312,6 @@ Option::parseCommandLine(QStringList &args)
fprintf(stderr, "***Option %s requires a parameter\n", qPrintable(args.at(x - 1)));
return Option::QMAKE_CMDLINE_SHOW_USAGE | Option::QMAKE_CMDLINE_ERROR;
}
- globals->commitCommandLineArguments(state);
- globals->debugLevel = Option::debug_level;
return Option::QMAKE_CMDLINE_SUCCESS;
}
@@ -374,6 +371,7 @@ Option::init(int argc, char **argv)
Option::qmake_mode = Option::QMAKE_GENERATE_MAKEFILE;
}
+ QMakeCmdLineParserState cmdstate(QDir::currentPath());
const QByteArray envflags = qgetenv("QMAKEFLAGS");
if (!envflags.isNull()) {
QStringList args;
@@ -399,7 +397,8 @@ Option::init(int argc, char **argv)
}
if (hasWord)
args << QString::fromLocal8Bit(buf);
- parseCommandLine(args);
+ parseCommandLine(args, cmdstate);
+ cmdstate.flush();
}
if(argc && argv) {
QStringList args;
@@ -430,7 +429,7 @@ Option::init(int argc, char **argv)
break;
}
- int ret = parseCommandLine(args);
+ int ret = parseCommandLine(args, cmdstate);
if(ret != Option::QMAKE_CMDLINE_SUCCESS) {
if ((ret & Option::QMAKE_CMDLINE_SHOW_USAGE) != 0)
usage(argv[0]);
@@ -439,6 +438,8 @@ Option::init(int argc, char **argv)
}
Option::qmake_args = args;
}
+ globals->commitCommandLineArguments(cmdstate);
+ globals->debugLevel = Option::debug_level;
//last chance for defaults
if(Option::qmake_mode == Option::QMAKE_GENERATE_MAKEFILE ||
diff --git a/qmake/option.h b/qmake/option.h
index 7ca0d274ff..541757b264 100644
--- a/qmake/option.h
+++ b/qmake/option.h
@@ -207,7 +207,7 @@ struct Option
};
private:
- static int parseCommandLine(QStringList &args);
+ static int parseCommandLine(QStringList &args, QMakeCmdLineParserState &state);
};
inline QString fixEnvVariables(const QString &x) { return Option::fixString(x, Option::FixEnvVars); }
diff --git a/qmake/property.cpp b/qmake/property.cpp
index 808800beef..c4fbcd6b78 100644
--- a/qmake/property.cpp
+++ b/qmake/property.cpp
@@ -118,10 +118,7 @@ QMakeProperty::value(const ProKey &vk)
return val;
initSettings();
- QString v = vk.toQString();
- if (!settings->contains(v))
- return settings->value("2.01a/" + v).toString(); // Backwards compat
- return settings->value(v).toString();
+ return settings->value(vk.toQString()).toString();
}
bool
@@ -135,7 +132,6 @@ QMakeProperty::setValue(QString var, const QString &val)
{
initSettings();
settings->setValue(var, val);
- settings->remove("2.01a/" + var); // Backwards compat
}
void
@@ -143,7 +139,6 @@ QMakeProperty::remove(const QString &var)
{
initSettings();
settings->remove(var);
- settings->remove("2.01a/" + var); // Backwards compat
}
bool
@@ -153,13 +148,8 @@ QMakeProperty::exec()
if(Option::qmake_mode == Option::QMAKE_QUERY_PROPERTY) {
if(Option::prop::properties.isEmpty()) {
initSettings();
- QStringList keys = settings->childKeys();
- settings->beginGroup("2.01a");
- keys += settings->childKeys();
- settings->endGroup();
- keys.removeDuplicates();
- foreach (const QString &key, keys) {
- QString val = settings->value(settings->contains(key) ? key : "2.01a/" + key).toString();
+ foreach (const QString &key, settings->childKeys()) {
+ QString val = settings->value(key).toString();
fprintf(stdout, "%s:%s\n", qPrintable(key), qPrintable(val));
}
QStringList specialProps;