summaryrefslogtreecommitdiffstats
path: root/qmake
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-02-20 01:01:00 +0100
committerEdward Welbourne <edward.welbourne@qt.io>2019-02-20 09:51:12 +0100
commit035f934d7a798e97bf0213a5d42a3d511132f03d (patch)
tree89aa6efdc86864ce479cddca6b9c4ba523c2754a /qmake
parentf4cc23cffbe3005f0a522cac938695e87ecd6407 (diff)
parentda4ab444ffac37514435364d4d3f0ad59d4f9bc3 (diff)
Merge remote-tracking branch 'origin/5.13' into dev
Conflicts: tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp Added tests/auto/testlib/selftests/expected_crashes_5.txt to work round the output of the crashes test (which exercises UB, see QTBUG-73903) being truncated on one test platform. Change-Id: I9cd3f2639b4e50c3c4513e14629a40bdca8f8273
Diffstat (limited to 'qmake')
-rw-r--r--qmake/Makefile.win324
-rw-r--r--qmake/doc/src/qmake-manual.qdoc11
-rw-r--r--qmake/generators/makefile.cpp3
-rw-r--r--qmake/generators/makefile.h1
-rw-r--r--qmake/generators/unix/unixmake.cpp9
-rw-r--r--qmake/generators/win32/msvc_nmake.cpp5
-rw-r--r--qmake/generators/win32/msvc_nmake.h1
-rw-r--r--qmake/generators/win32/msvc_objectmodel.cpp3
-rw-r--r--qmake/generators/win32/msvc_objectmodel.h3
-rw-r--r--qmake/generators/win32/msvc_vcproj.cpp24
-rw-r--r--qmake/library/ioutils.cpp7
-rw-r--r--qmake/qmake.pro4
12 files changed, 51 insertions, 24 deletions
diff --git a/qmake/Makefile.win32 b/qmake/Makefile.win32
index ed738e0c02..3f13df884a 100644
--- a/qmake/Makefile.win32
+++ b/qmake/Makefile.win32
@@ -12,11 +12,11 @@ QMKSRC = $(SOURCE_PATH)\qmake
#
!if "$(QMAKESPEC)" == "win32-icc"
CXX = icl
-LINKER = link
+LINKER = xilink
CFLAGS_EXTRA = /Zc:forScope /Qstd=c++11
!elseif "$(QMAKESPEC)" == "win32-clang-msvc"
CXX = clang-cl
-LINKER = link
+LINKER = lld-link
CFLAGS_EXTRA = -fms-compatibility-version=19.00.23506 -Wno-microsoft-enum-value
!else
CXX = cl
diff --git a/qmake/doc/src/qmake-manual.qdoc b/qmake/doc/src/qmake-manual.qdoc
index 3601fe7748..fcefe1381b 100644
--- a/qmake/doc/src/qmake-manual.qdoc
+++ b/qmake/doc/src/qmake-manual.qdoc
@@ -1060,8 +1060,12 @@
proper include paths, compiler flags and libraries will
automatically be added to the project.
\row \li console \li The target is a Win32 console application (app only). The
- proper include paths, compiler flags and libraries will
- automatically be added to the project.
+ proper include paths, compiler flags and libraries will automatically be
+ added to the project. Consider using the option \c{cmdline} for
+ cross-platform applications.
+ \row \li cmdline \li The target is a cross-platform command line application.
+ On Windows, this implies \c{CONFIG += console}.
+ On macOS, this implies \c{CONFIG -= app_bundle}.
\row \li shared \li{1,2} The target is a shared object/DLL. The proper
include paths, compiler flags and libraries will automatically be
added to the project. Note that \c dll can also be used on all platforms;
@@ -4909,8 +4913,7 @@
\code
TEMPLATE = app
LANGUAGE = C++
- CONFIG += console precompile_header
- CONFIG -= app_bundle
+ CONFIG += cmdline precompile_header
# Use Precompiled headers (PCH)
PRECOMPILED_HEADER = stable.h
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index 9ea0fe3a22..b9ac3d2b5e 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -2585,6 +2585,9 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
{ //actually compile
t << subtarget->target << ":";
+ auto extraDeps = extraSubTargetDependencies();
+ if (!extraDeps.isEmpty())
+ t << " " << valList(extraDeps);
if(!subtarget->depends.isEmpty())
t << " " << valList(subtarget->depends);
t << " FORCE";
diff --git a/qmake/generators/makefile.h b/qmake/generators/makefile.h
index 0535017ff6..350ebd377a 100644
--- a/qmake/generators/makefile.h
+++ b/qmake/generators/makefile.h
@@ -119,6 +119,7 @@ protected:
virtual void writeSubMakeCall(QTextStream &t, const QString &outDirectory_cdin,
const QString &makeFileIn);
virtual void writeSubTargets(QTextStream &t, QList<SubTarget*> subtargets, int flags);
+ virtual ProStringList extraSubTargetDependencies() { return {}; }
//extra compiler interface
bool verifyExtraCompiler(const ProString &c, const QString &f);
diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp
index 4cbe06d9dc..7f42fbe09e 100644
--- a/qmake/generators/unix/unixmake.cpp
+++ b/qmake/generators/unix/unixmake.cpp
@@ -506,17 +506,14 @@ UnixMakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags)
if (opt.startsWith("-Xarch"))
opt = l.at(++lit); // The user has done the right thing and prefixed each part
}
- bool found = false;
for(int x = 0; x < lflags[arch].size(); ++x) {
if (lflags[arch].at(x) == "-framework" && lflags[arch].at(++x) == opt) {
- found = true;
+ lflags[arch].remove(x - 1, 2);
break;
}
}
- if(!found) {
- lflags[arch].append("-framework");
- lflags[arch].append(opt);
- }
+ lflags[arch].append("-framework");
+ lflags[arch].append(opt);
} else {
lflags[arch].append(opt);
}
diff --git a/qmake/generators/win32/msvc_nmake.cpp b/qmake/generators/win32/msvc_nmake.cpp
index aa3d389b67..a6e850a036 100644
--- a/qmake/generators/win32/msvc_nmake.cpp
+++ b/qmake/generators/win32/msvc_nmake.cpp
@@ -76,6 +76,11 @@ void NmakeMakefileGenerator::writeSubMakeCall(QTextStream &t, const QString &cal
Win32MakefileGenerator::writeSubMakeCall(t, callPrefix, makeArguments);
}
+ProStringList NmakeMakefileGenerator::extraSubTargetDependencies()
+{
+ return { "$(MAKEFILE)" };
+}
+
QString NmakeMakefileGenerator::defaultInstall(const QString &t)
{
QString ret = Win32MakefileGenerator::defaultInstall(t);
diff --git a/qmake/generators/win32/msvc_nmake.h b/qmake/generators/win32/msvc_nmake.h
index 67a56c7813..5bfdba2bbc 100644
--- a/qmake/generators/win32/msvc_nmake.h
+++ b/qmake/generators/win32/msvc_nmake.h
@@ -48,6 +48,7 @@ class NmakeMakefileGenerator : public Win32MakefileGenerator
protected:
void writeSubMakeCall(QTextStream &t, const QString &callPrefix,
const QString &makeArguments) override;
+ ProStringList extraSubTargetDependencies() override;
QString defaultInstall(const QString &t) override;
QStringList &findDependencies(const QString &file) override;
QString var(const ProKey &value) const override;
diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp
index 7caa94c512..cf0b96ec9f 100644
--- a/qmake/generators/win32/msvc_objectmodel.cpp
+++ b/qmake/generators/win32/msvc_objectmodel.cpp
@@ -55,7 +55,8 @@ static DotNET vsVersionFromString(const char *versionString)
{ "11.0", NET2012 },
{ "12.0", NET2013 },
{ "14.0", NET2015 },
- { "15.0", NET2017 }
+ { "15.0", NET2017 },
+ { "16.0", NET2019 }
};
DotNET result = NETUnknown;
for (const auto entry : mapping) {
diff --git a/qmake/generators/win32/msvc_objectmodel.h b/qmake/generators/win32/msvc_objectmodel.h
index f8f9804c27..33a96bf85e 100644
--- a/qmake/generators/win32/msvc_objectmodel.h
+++ b/qmake/generators/win32/msvc_objectmodel.h
@@ -52,7 +52,8 @@ enum DotNET {
NET2012 = 0xb0,
NET2013 = 0xc0,
NET2015 = 0xd0,
- NET2017 = 0xe0
+ NET2017 = 0xe0,
+ NET2019
};
DotNET vsVersionFromString(const ProString &versionString);
diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp
index d231260886..0874a6d273 100644
--- a/qmake/generators/win32/msvc_vcproj.cpp
+++ b/qmake/generators/win32/msvc_vcproj.cpp
@@ -73,7 +73,9 @@ const char _slnHeader120[] = "Microsoft Visual Studio Solution File, Format
const char _slnHeader140[] = "Microsoft Visual Studio Solution File, Format Version 12.00"
"\n# Visual Studio 2015";
const char _slnHeader141[] = "Microsoft Visual Studio Solution File, Format Version 12.00"
- "\n# Visual Studio 2017";
+ "\n# Visual Studio 15";
+const char _slnHeader142[] = "Microsoft Visual Studio Solution File, Format Version 12.00"
+ "\n# Visual Studio Version 16";
// The following UUID _may_ change for later servicepacks...
// If so we need to search through the registry at
// HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.0\Projects
@@ -305,6 +307,8 @@ QString VcprojGenerator::retrievePlatformToolSet() const
return QStringLiteral("v140");
case NET2017:
return QStringLiteral("v141");
+ case NET2019:
+ return QStringLiteral("v142");
default:
return QString();
}
@@ -531,6 +535,9 @@ void VcprojGenerator::writeSubDirs(QTextStream &t)
}
switch (vcProject.Configuration.CompilerVersion) {
+ case NET2019:
+ t << _slnHeader142;
+ break;
case NET2017:
t << _slnHeader141;
break;
@@ -881,6 +888,9 @@ void VcprojGenerator::initProject()
// Own elements -----------------------------
vcProject.Name = project->first("QMAKE_ORIG_TARGET").toQString();
switch (vcProject.Configuration.CompilerVersion) {
+ case NET2019:
+ vcProject.Version = "16.00";
+ break;
case NET2017:
vcProject.Version = "15.00";
break;
@@ -1548,14 +1558,14 @@ void VcprojGenerator::initExtraCompilerOutputs()
extraCompile.Filter = "";
extraCompile.Guid = QString(_GUIDExtraCompilerFiles) + "-" + (*it);
- // If the extra compiler has a variable_out set the output file
- // is added to an other file list, and does not need its own..
bool addOnInput = hasBuiltinCompiler(firstExpandedOutputFileName(*it));
- const ProString &tmp_other_out = project->first(ProKey(*it + ".variable_out"));
- if (!tmp_other_out.isEmpty() && !addOnInput)
- continue;
-
if (!addOnInput) {
+ // If the extra compiler has a variable_out set that is already handled
+ // some other place, ignore it.
+ const ProString &outputVar = project->first(ProKey(*it + ".variable_out"));
+ if (!outputVar.isEmpty() && otherFilters.contains(outputVar))
+ continue;
+
QString tmp_out = project->first(ProKey(*it + ".output")).toQString();
if (project->values(ProKey(*it + ".CONFIG")).indexOf("combine") != -1) {
// Combined output, only one file result
diff --git a/qmake/library/ioutils.cpp b/qmake/library/ioutils.cpp
index 2b2c6d0078..3e49a99cd5 100644
--- a/qmake/library/ioutils.cpp
+++ b/qmake/library/ioutils.cpp
@@ -77,7 +77,12 @@ bool IoUtils::isRelativePath(const QString &path)
&& (path.at(2) == QLatin1Char('/') || path.at(2) == QLatin1Char('\\'))) {
return false;
}
- // (... unless, of course, they're UNC, which qmake fails on anyway)
+ // ... unless, of course, they're UNC:
+ if (path.length() >= 2
+ && (path.at(0).unicode() == '\\' || path.at(0).unicode() == '/')
+ && path.at(1) == path.at(0)) {
+ return false;
+ }
#else
if (path.startsWith(QLatin1Char('/')))
return false;
diff --git a/qmake/qmake.pro b/qmake/qmake.pro
index d704fdb6dc..6a6116c8db 100644
--- a/qmake/qmake.pro
+++ b/qmake/qmake.pro
@@ -3,8 +3,8 @@
# and the configures.
option(host_build)
-CONFIG += console
-CONFIG -= qt app_bundle
+CONFIG += cmdline
+CONFIG -= qt
DEFINES += \
PROEVALUATOR_FULL \