Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/5.9' into 5.10
Browse files Browse the repository at this point in the history
 Conflicts:
	src/corelib/io/qprocess_win.cpp

Change-Id: Ib61b74a69922ec1e9eecbba5f75352b4ec167fa9
  • Loading branch information
liangqi committed Jan 19, 2018
2 parents 0ffc398 + 13f6eb9 commit 739585b
Show file tree
Hide file tree
Showing 30 changed files with 264 additions and 138 deletions.
47 changes: 0 additions & 47 deletions config.tests/win/angle_d3d11_qdtd/angle_d3d11_qdtd.cpp

This file was deleted.

3 changes: 0 additions & 3 deletions config.tests/win/angle_d3d11_qdtd/angle_d3d11_qdtd.pro

This file was deleted.

3 changes: 3 additions & 0 deletions config_help.txt
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ Build options:
-gcov ................ Instrument with the GCov code coverage tool [no]
-sanitize {address|thread|memory|undefined}
Instrument with the specified compiler sanitizer.
Note that some sanitizers cannot be combined;
for example, -sanitize address cannot be combined with
-sanitize thread.

-c++std <edition> .... Select C++ standard <edition> [c++1z/c++14/c++11]
(Not supported with MSVC)
Expand Down
6 changes: 6 additions & 0 deletions dist/changes-5.9.4
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@ QtCore
QtNetwork
---------

- Bearer Management:
* [QTBUG-40332] The nativewifi (Windows) bearer plugin was determined
to be causing network interference in the form of system-wide higher
latency and has been disabled. The CoreWlan (macOS) plugin has also
been disabled.

- QUdpSocket:
* [QTBUG-64718] Fixed a regression from Qt 5.9.3 caused by an apparent
Win32 API quirk we triggered when using readDatagram(), resulting in
Expand Down
1 change: 1 addition & 0 deletions doc/global/macros.qdocconf
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ macro.QA = "\\e{Qt Assistant}"
macro.QD = "\\e{Qt Designer}"
macro.QL = "\\e{Qt Linguist}"
macro.QQV = "\\e{Qt QML Viewer}"
macro.QtVersion = "$QT_VERSION"
macro.param = "\\e"
macro.raisedaster.HTML = "<sup>*</sup>"
macro.rarrow.HTML = "&rarr;"
Expand Down
6 changes: 4 additions & 2 deletions mkspecs/common/msvc-desktop.conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@
MAKEFILE_GENERATOR = MSVC.NET
QMAKE_PLATFORM = win32
QMAKE_COMPILER = msvc
CONFIG += incremental flat debug_and_release debug_and_release_target precompile_header autogen_precompile_source embed_manifest_dll embed_manifest_exe
CONFIG += flat debug_and_release debug_and_release_target precompile_header autogen_precompile_source embed_manifest_dll embed_manifest_exe
DEFINES += UNICODE _UNICODE WIN32
QMAKE_COMPILER_DEFINES += _WIN32
contains(QMAKE_TARGET.arch, x86_64) {
DEFINES += WIN64
QMAKE_COMPILER_DEFINES += _WIN64
}

QMAKE_CFLAGS_OPTIMIZE_DEBUG = -Od
QMAKE_CFLAGS_OPTIMIZE = -O2
QMAKE_CFLAGS_OPTIMIZE_SIZE = -O1

Expand Down Expand Up @@ -94,7 +95,8 @@ QMAKE_EXTENSION_SHLIB = dll
QMAKE_PREFIX_STATICLIB =
QMAKE_EXTENSION_STATICLIB = lib

QMAKE_LIBS_GUI = gdi32.lib comdlg32.lib oleaut32.lib imm32.lib winmm.lib ws2_32.lib ole32.lib user32.lib advapi32.lib
QMAKE_LIBS =
QMAKE_LIBS_GUI = gdi32.lib comdlg32.lib oleaut32.lib imm32.lib winmm.lib ws2_32.lib ole32.lib uuid.lib user32.lib advapi32.lib
QMAKE_LIBS_NETWORK = ws2_32.lib
QMAKE_LIBS_OPENGL = glu32.lib opengl32.lib gdi32.lib user32.lib
QMAKE_LIBS_OPENGL_ES2 = gdi32.lib user32.lib
Expand Down
5 changes: 5 additions & 0 deletions mkspecs/common/msvc-version.conf
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ greaterThan(QMAKE_MSC_VER, 1909) {
# API is used in direct2d, but also in multimedia, positioning and sensors.
# We can try again with a later version of Visual Studio.
# QMAKE_CXXFLAGS_STRICTCXX = -permissive-
# MSVC partially supports the following, but '__cplusplus' definition is set
# as for C++98 until MSVC fully conforms with C++14, see
# https://developercommunity.visualstudio.com/content/problem/139261/msvc-incorrectly-defines-cplusplus.html
# QMAKE_CXXFLAGS_CXX14 = -std:c++14
# QMAKE_CXXFLAGS_CXX1Z = -std:c++latest
}

greaterThan(QMAKE_MSC_VER, 1910) {
Expand Down
18 changes: 12 additions & 6 deletions mkspecs/features/qt_example_installs.prf
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,25 @@ contains(TEMPLATE, .*app): \
for(ex, EXAMPLE_FILES): \
sourcefiles += $$files($$absolute_path($$ex, $$_PRO_FILE_PWD_))
for(res, RESOURCES) {
rfile = $$cat($$absolute_path($$res, $$_PRO_FILE_PWD_), lines)
for(rline, rfile) {
!contains(res, \\.qrc$): \
next()
rfile = $$absolute_path($$res, $$_PRO_FILE_PWD_)
rpath = $$dirname(rfile)
rcont = $$cat($$rfile, lines)
for (rline, rcont) {
resrc = $$replace(rline, ^[ \\t]*<file[^>]*>([^<]+)</file>[ \\t]*$, \\1)
!equals(resrc, $$rline): \
sourcefiles += $$resrc
sourcefiles += $$absolute_path($$resrc, $$rpath)
}
}
for(res, RC_FILE) {
rfile = $$cat($$absolute_path($$res, $$_PRO_FILE_PWD_), lines)
for(rline, rfile) {
rfile = $$absolute_path($$res, $$_PRO_FILE_PWD_)
rpath = $$dirname(rfile)
rcont = $$cat($$rfile, lines)
for (rline, rcont) {
resrc = $$replace(rline, "^\\d+\\s+ICON\\s+[^\"]*\"([^\"]+)\"\$", \\1)
!equals(resrc, $$rline): \
sourcefiles += $$resrc
sourcefiles += $$absolute_path($$resrc, $$rpath)
}
}
sourcefiles += \
Expand Down
2 changes: 1 addition & 1 deletion mkspecs/features/testcase.prf
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ unix {
$${type}.commands += $${TEST_TARGET_DIR}/$(QMAKE_TARGET)
} else {
# Windows
!isEmpty(TEST_TARGET_DIR): TEST_TARGET_DIR = $${TEST_TARGET_DIR}$${QMAKE_DIR_SEP}
!isEmpty(TEST_TARGET_DIR): TEST_TARGET_DIR = $$shell_path($$TEST_TARGET_DIR)$${QMAKE_DIR_SEP}
$${type}.commands += $${TEST_TARGET_DIR}$(TARGET)
}

Expand Down
9 changes: 7 additions & 2 deletions mkspecs/win32-g++/qmake.conf
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@ include(../common/g++-base.conf)
MAKEFILE_GENERATOR = MINGW
QMAKE_PLATFORM = win32 mingw
CONFIG += debug_and_release debug_and_release_target precompile_header
DEFINES += UNICODE _UNICODE
QMAKE_COMPILER_DEFINES += __GNUC__ WIN32
DEFINES += UNICODE _UNICODE WIN32
QMAKE_COMPILER_DEFINES += __GNUC__ _WIN32
# can't add 'DEFINES += WIN64' and 'QMAKE_COMPILER_DEFINES += _WIN64' defines for
# x86_64 platform similar to 'msvc-desktop.conf' toolchain, because, unlike for MSVC,
# 'QMAKE_TARGET.arch' is inherently unavailable.

QMAKE_CC = $${CROSS_COMPILE}gcc
QMAKE_LEX = flex
Expand All @@ -32,6 +35,8 @@ QMAKE_CFLAGS_AESNI = -maes
QMAKE_CFLAGS_SHANI = -msha

QMAKE_CXX = $${CROSS_COMPILE}g++
QMAKE_CXXFLAGS = $$QMAKE_CFLAGS
QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON
QMAKE_CXXFLAGS_RTTI_ON = -frtti
QMAKE_CXXFLAGS_RTTI_OFF = -fno-rtti
QMAKE_CXXFLAGS_EXCEPTIONS_ON = -fexceptions -mthreads
Expand Down
15 changes: 9 additions & 6 deletions mkspecs/win32-icc/qmake.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Written for Intel C++ Compiler on Windows / icl 16.0 or higher
#

# Use the Microsoft (R) C/C++ Optimizing Compiler configuration,
# Use the Microsoft C/C++ Optimizing Compiler configuration,
# since ICC on Windows pretends to be MSVC

include(../common/msvc-desktop.conf)
Expand All @@ -13,11 +13,14 @@ include(../common/msvc-desktop.conf)

QMAKE_COMPILER += intel_icl

QMAKE_CFLAGS_OPTIMIZE_FULL = -O3

QMAKE_CC = icl
QMAKE_CFLAGS = -nologo -Zm200 /Qprec /Qwd1744,1738,809,3373
QMAKE_CFLAGS_WARN_ON = -W3 /Qwd673
QMAKE_CFLAGS_WARN_OFF = -W0 /Qwd673
QMAKE_CFLAGS_DEBUG = -Od -Zi -MDd
QMAKE_CFLAGS = -nologo -Zc:wchar_t -Qprec -Zm200 -Qdiag-disable:1744,1738,809,3373
QMAKE_CFLAGS_WARN_ON = -W3 -Qdiag-disable:673
QMAKE_CFLAGS_WARN_OFF = -W0 -Qdiag-disable:673
QMAKE_CFLAGS_DEBUG = $$QMAKE_CFLAGS_OPTIMIZE_DEBUG -Zi -MDd
QMAKE_CFLAGS_UTF8_SOURCE = -Qoption,cpp,--unicode_source_kind,UTF-8
QMAKE_CFLAGS_LTCG = -Qipo
QMAKE_CFLAGS_DISABLE_LTCG = -Qno-ipo

Expand Down Expand Up @@ -46,7 +49,7 @@ QMAKE_CXXFLAGS_WARN_OFF = $$QMAKE_CFLAGS_WARN_OFF
QMAKE_CXXFLAGS_CXX11 = -Qstd=c++11
# ICC supports the following but Qt won't compile
#QMAKE_CXXFLAGS_CXX14 = -Qstd=c++14
#QMAKE_CXXFLAGS_CXX1Z = -Qstd=c++1z
#QMAKE_CXXFLAGS_CXX1Z = -Qstd=c++17
QMAKE_CXXFLAGS_LTCG = $$QMAKE_CFLAGS_LTCG
QMAKE_CXXFLAGS_DISABLE_LTCG = $$QMAKE_CFLAGS_DISABLE_LTCG

Expand Down
23 changes: 15 additions & 8 deletions qmake/library/ioutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,21 +66,22 @@ IoUtils::FileType IoUtils::fileType(const QString &fileName)

bool IoUtils::isRelativePath(const QString &path)
{
if (path.startsWith(QLatin1Char('/')))
return false;
#ifdef QMAKE_BUILTIN_PRFS
if (path.startsWith(QLatin1String(":/")))
return false;
#endif
#ifdef Q_OS_WIN
if (path.startsWith(QLatin1Char('\\')))
return false;
// Unlike QFileInfo, this won't accept a relative path with a drive letter.
// Such paths result in a royal mess anyway ...
// Unlike QFileInfo, this considers only paths with both a drive prefix and
// a subsequent (back-)slash absolute:
if (path.length() >= 3 && path.at(1) == QLatin1Char(':') && path.at(0).isLetter()
&& (path.at(2) == QLatin1Char('/') || path.at(2) == QLatin1Char('\\')))
&& (path.at(2) == QLatin1Char('/') || path.at(2) == QLatin1Char('\\'))) {
return false;
#endif
}
// (... unless, of course, they're UNC, which qmake fails on anyway)
#else
if (path.startsWith(QLatin1Char('/')))
return false;
#endif // Q_OS_WIN
return true;
}

Expand All @@ -100,6 +101,12 @@ QString IoUtils::resolvePath(const QString &baseDir, const QString &fileName)
return QString();
if (isAbsolutePath(fileName))
return QDir::cleanPath(fileName);
#ifdef Q_OS_WIN // Add drive to otherwise-absolute path:
if (fileName.at(0).unicode() == '/' || fileName.at(0).unicode() == '\\') {
Q_ASSERT(isAbsolutePath(baseDir));
return QDir::cleanPath(baseDir.left(2) + fileName);
}
#endif // Q_OS_WIN
return QDir::cleanPath(baseDir + QLatin1Char('/') + fileName);
}

Expand Down
13 changes: 7 additions & 6 deletions qmake/library/qmakebuiltins.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1177,9 +1177,9 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinExpand(
if (args.count() > 2) {
evalError(fL1S("absolute_path(path[, base]) requires one or two arguments."));
} else {
QString rstr = QDir::cleanPath(
QDir(args.count() > 1 ? args.at(1).toQString(m_tmp2) : currentDirectory())
.absoluteFilePath(args.at(0).toQString(m_tmp1)));
QString arg = args.at(0).toQString(m_tmp1);
QString baseDir = args.count() > 1 ? args.at(1).toQString(m_tmp2) : currentDirectory();
QString rstr = arg.isEmpty() ? baseDir : IoUtils::resolvePath(baseDir, arg);
ret << (rstr.isSharedWith(m_tmp1)
? args.at(0)
: args.count() > 1 && rstr.isSharedWith(m_tmp2)
Expand All @@ -1191,9 +1191,10 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinExpand(
if (args.count() > 2) {
evalError(fL1S("relative_path(path[, base]) requires one or two arguments."));
} else {
QDir baseDir(args.count() > 1 ? args.at(1).toQString(m_tmp2) : currentDirectory());
QString rstr = baseDir.relativeFilePath(baseDir.absoluteFilePath(
args.at(0).toQString(m_tmp1)));
QString arg = args.at(0).toQString(m_tmp1);
QString baseDir = args.count() > 1 ? args.at(1).toQString(m_tmp2) : currentDirectory();
QString absArg = arg.isEmpty() ? baseDir : IoUtils::resolvePath(baseDir, arg);
QString rstr = QDir(baseDir).relativeFilePath(absArg);
ret << (rstr.isSharedWith(m_tmp1) ? args.at(0) : ProString(rstr).setSource(args.at(0)));
}
break;
Expand Down
15 changes: 8 additions & 7 deletions qmake/library/qmakeglobals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
#endif

QT_BEGIN_NAMESPACE
using namespace QMakeInternal; // for IoUtils

#define fL1S(s) QString::fromLatin1(s)

Expand Down Expand Up @@ -96,9 +97,9 @@ QString QMakeGlobals::cleanSpec(QMakeCmdLineParserState &state, const QString &s
{
QString ret = QDir::cleanPath(spec);
if (ret.contains(QLatin1Char('/'))) {
QString absRet = QDir(state.pwd).absoluteFilePath(ret);
QString absRet = IoUtils::resolvePath(state.pwd, ret);
if (QFile::exists(absRet))
ret = QDir::cleanPath(absRet);
ret = absRet;
}
return ret;
}
Expand Down Expand Up @@ -126,10 +127,10 @@ QMakeGlobals::ArgumentReturn QMakeGlobals::addCommandLineArguments(
user_template_prefix = arg;
break;
case ArgCache:
cachefile = args[*pos] = QDir::cleanPath(QDir(state.pwd).absoluteFilePath(arg));
cachefile = args[*pos] = IoUtils::resolvePath(state.pwd, arg);
break;
case ArgQtConf:
qtconf = args[*pos] = QDir::cleanPath(QDir(state.pwd).absoluteFilePath(arg));
qtconf = args[*pos] = IoUtils::resolvePath(state.pwd, arg);
break;
default:
if (arg.startsWith(QLatin1Char('-'))) {
Expand Down Expand Up @@ -259,11 +260,11 @@ QStringList QMakeGlobals::splitPathList(const QString &val) const
{
QStringList ret;
if (!val.isEmpty()) {
QDir bdir;
QString cwd(QDir::currentPath());
const QStringList vals = val.split(dirlist_sep);
ret.reserve(vals.length());
for (const QString &it : vals)
ret << QDir::cleanPath(bdir.absoluteFilePath(it));
ret << IoUtils::resolvePath(cwd, it);
}
return ret;
}
Expand Down Expand Up @@ -318,7 +319,7 @@ bool QMakeGlobals::initProperties()
return false;
data = proc.readAll();
#else
if (FILE *proc = QT_POPEN(QString(QMakeInternal::IoUtils::shellQuote(qmake_abslocation)
if (FILE *proc = QT_POPEN(QString(IoUtils::shellQuote(qmake_abslocation)
+ QLatin1String(" -query")).toLocal8Bit(), QT_POPEN_READ)) {
char buff[1024];
while (!feof(proc))
Expand Down
5 changes: 4 additions & 1 deletion qmake/option.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

#include "option.h"
#include "cachekeys.h"
#include <ioutils.h>
#include <qdir.h>
#include <qregexp.h>
#include <qhash.h>
Expand All @@ -38,6 +39,8 @@

QT_BEGIN_NAMESPACE

using namespace QMakeInternal;

EvalHandler Option::evalHandler;
QMakeGlobals *Option::globals;
ProFileCache *Option::proFileCache;
Expand Down Expand Up @@ -325,7 +328,7 @@ Option::init(int argc, char **argv)
#endif
if(Option::qmake_mode == Option::QMAKE_GENERATE_NOTHING)
Option::qmake_mode = default_mode(argv0);
if(!argv0.isEmpty() && !QFileInfo(argv0).isRelative()) {
if (!argv0.isEmpty() && IoUtils::isAbsolutePath(argv0)) {
globals->qmake_abslocation = argv0;
} else if (argv0.contains(QLatin1Char('/'))
#ifdef Q_OS_WIN
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class HelloWorldTask : public QRunnable
{
qDebug() << "Hello world from thread" << QThread::currentThread();
}
}
};

HelloWorldTask *hello = new HelloWorldTask();
// QThreadPool takes ownership and deletes 'hello' automatically
Expand Down
Loading

0 comments on commit 739585b

Please sign in to comment.