Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/5.9' into dev
Browse files Browse the repository at this point in the history
Conflicts:
	src/plugins/platforms/cocoa/qcocoamenu.h
	src/plugins/platforms/cocoa/qcocoamenu.mm
	src/plugins/platforms/cocoa/qcocoawindow.mm
	src/widgets/styles/qstylehelper_p.h

Change-Id: I54247c98dd79d2b3826fc062b8b11048c9c7d9bb
  • Loading branch information
liangqi committed Aug 15, 2017
2 parents 79f679d + 8bebded commit 106d3b9
Show file tree
Hide file tree
Showing 174 changed files with 97,791 additions and 759 deletions.
2 changes: 1 addition & 1 deletion mkspecs/common/ghs-base.conf
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_LFLAGS_RELEASE -g
QMAKE_LFLAGS_CXX11 += --c++11 --thread_local_storage
QMAKE_LFLAGS_EXCEPTIONS_ON += --exceptions

QMAKE_LIBS_CORE = -lposix -livfs -lsocket -lnet -ldl
QMAKE_LIBS_CORE = -lposix -livfs -lsocket -lnet -lshm_client
9 changes: 3 additions & 6 deletions mkspecs/features/qt_configure.prf
Original file line number Diff line number Diff line change
Expand Up @@ -492,8 +492,8 @@ defineTest(qtConfSetupLibraries) {
# overrides from the command line are accepted.
defineTest(qtConfLibrary_inline) {
lib = $$eval($${1}.library)
!defined($${1}.libs, var): \
error("'inline' source in library '$$lib' does not specify 'libs'.")
!defined($${1}.libs, var):isEmpty($${1}.builds._KEYS_): \
error("'inline' source in library '$$lib' specifies neither 'libs' nor 'builds'.")

# if multiple libraries provide the same export, it makes sense
# to make them recognize the same input variables.
Expand Down Expand Up @@ -2028,10 +2028,7 @@ for (currentConfig, allConfigs) {
}
qtConfCheckErrors()

!isEmpty(_QMAKE_SUPER_CACHE_): \
QMAKE_CONFIG_CACHE = $$dirname(_QMAKE_SUPER_CACHE_)/config.cache
else: \
QMAKE_CONFIG_CACHE = $$dirname(_QMAKE_CACHE_)/config.cache
QMAKE_CONFIG_CACHE = $$OUT_PWD/config.cache
QMAKE_CONFIG_CACHE_USE = $$eval(config.input.cache_use)
isEmpty(QMAKE_CONFIG_CACHE_USE): \
QMAKE_CONFIG_CACHE_USE = all
Expand Down
186 changes: 97 additions & 89 deletions mkspecs/features/qt_example_installs.prf
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@
# We mean it.
#

contains(TEMPLATE, .*app): \
qtSetQmlPath()

contains(TEMPLATE, "vc.*"): return()

defineTest(addInstallFiles) {
for(sf, 2) {
sf = $$relative_path($$sf, $$_PRO_FILE_PWD_)
Expand All @@ -31,99 +26,112 @@ defineTest(addInstallFiles) {
}

probase = $$relative_path($$_PRO_FILE_PWD_, $$dirname(_QMAKE_CONF_)/examples)
!isEmpty(probase):!contains(probase, ^\\..*):!isEmpty(_QMAKE_CACHE_) {
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) {
resrc = $$replace(rline, ^[ \\t]*<file[^>]*>([^<]+)</file>[ \\t]*$, \\1)
!equals(resrc, $$rline): \
sourcefiles += $$resrc
}
isEmpty(probase)|contains(probase, ^\\..*): \
return()

isEmpty(_QMAKE_CACHE_) {
!equals(OUT_PWD, $$_PRO_FILE_PWD_): \
return()
error("You cannot build examples inside the Qt source tree, except as part of a proper Qt build.")
}

contains(TEMPLATE, "vc.*"): \
return()

contains(TEMPLATE, .*app): \
qtSetQmlPath()

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) {
resrc = $$replace(rline, ^[ \\t]*<file[^>]*>([^<]+)</file>[ \\t]*$, \\1)
!equals(resrc, $$rline): \
sourcefiles += $$resrc
}
for(res, RC_FILE) {
rfile = $$cat($$absolute_path($$res, $$_PRO_FILE_PWD_), lines)
for(rline, rfile) {
resrc = $$replace(rline, "^\\d+\\s+ICON\\s+[^\"]*\"([^\"]+)\"\$", \\1)
!equals(resrc, $$rline): \
sourcefiles += $$resrc
}
}
for(res, RC_FILE) {
rfile = $$cat($$absolute_path($$res, $$_PRO_FILE_PWD_), lines)
for(rline, rfile) {
resrc = $$replace(rline, "^\\d+\\s+ICON\\s+[^\"]*\"([^\"]+)\"\$", \\1)
!equals(resrc, $$rline): \
sourcefiles += $$resrc
}
sourcefiles += \
$$ANDROID_PACKAGE_SOURCE_DIR \
$$QMAKE_INFO_PLIST \
$$DISTFILES
extras = \
$$_PRO_FILE_PWD_/README \
$$_PRO_FILE_PWD_/README.TXT \
$$files($$_PRO_FILE_PWD_/*.pri) \
$$replace(_PRO_FILE_, \\.pro$, .qmlproject) \
$$replace(_PRO_FILE_, \\.pro$, .json) \
$$replace(_PRO_FILE_, \\.pro$, .inf)
for(extra, extras): \
exists($$extra): \
sourcefiles += $$extra
}
sourcefiles += \
$$ANDROID_PACKAGE_SOURCE_DIR \
$$QMAKE_INFO_PLIST \
$$DISTFILES
extras = \
$$_PRO_FILE_PWD_/README \
$$_PRO_FILE_PWD_/README.TXT \
$$files($$_PRO_FILE_PWD_/*.pri) \
$$replace(_PRO_FILE_, \\.pro$, .qmlproject) \
$$replace(_PRO_FILE_, \\.pro$, .json) \
$$replace(_PRO_FILE_, \\.pro$, .inf)
for(extra, extras): \
exists($$extra): \
sourcefiles += $$extra

# Just for Qt Creator
OTHER_FILES += $$sourcefiles
# Just for Qt Creator
OTHER_FILES += $$sourcefiles

sourcefiles += \
$$_PRO_FILE_ $$RC_FILE $$DEF_FILE \
$$SOURCES $$HEADERS $$FORMS $$RESOURCES $$TRANSLATIONS \
$$DBUS_ADAPTORS $$DBUS_INTERFACES
addInstallFiles(sources.files, $$sourcefiles)
sources.path = $$[QT_INSTALL_EXAMPLES]/$$probase
INSTALLS += sources
sourcefiles += \
$$_PRO_FILE_ $$RC_FILE $$DEF_FILE \
$$SOURCES $$HEADERS $$FORMS $$RESOURCES $$TRANSLATIONS \
$$DBUS_ADAPTORS $$DBUS_INTERFACES
addInstallFiles(sources.files, $$sourcefiles)
sources.path = $$[QT_INSTALL_EXAMPLES]/$$probase
INSTALLS += sources

check_examples {
srcfiles = $$sources.files
for(inst, INSTALLS): \
!equals(inst, target):!contains($${inst}.CONFIG, no_check_exist): \
for(file, $${inst}.files): \
instfiles += $$files($$absolute_path($$file, $$_PRO_FILE_PWD_))
addInstallFiles(srcfiles, $$instfiles)
check_examples {
srcfiles = $$sources.files
for(inst, INSTALLS): \
!equals(inst, target):!contains($${inst}.CONFIG, no_check_exist): \
for(file, $${inst}.files): \
instfiles += $$files($$absolute_path($$file, $$_PRO_FILE_PWD_))
addInstallFiles(srcfiles, $$instfiles)

thefiles = $$files($$_PRO_FILE_PWD_/*)
for(i, thefiles): \
allfiles += $$relative_path($$i, $$_PRO_FILE_PWD_)
for(i, srcfiles): \
allfiles -= $$relative_path($$i, $$_PRO_FILE_PWD_)
for(i, SUBDIRS) {
sd = $$eval($${i}.file)
!isEmpty(sd) {
sd ~= s,/.*,,
} else {
sd = $$eval($${i}.subdir)
isEmpty(sd): sd = $$i
}
allfiles -= $$sd
thefiles = $$files($$_PRO_FILE_PWD_/*)
for(i, thefiles): \
allfiles += $$relative_path($$i, $$_PRO_FILE_PWD_)
for(i, srcfiles): \
allfiles -= $$relative_path($$i, $$_PRO_FILE_PWD_)
for(i, SUBDIRS) {
sd = $$eval($${i}.file)
!isEmpty(sd) {
sd ~= s,/.*,,
} else {
sd = $$eval($${i}.subdir)
isEmpty(sd): sd = $$i
}
allfiles -= doc
!isEmpty(allfiles): warning("remaining files in $$_PRO_FILE_PWD_: $$allfiles")
allfiles -= $$sd
}
allfiles -= doc
!isEmpty(allfiles): warning("remaining files in $$_PRO_FILE_PWD_: $$allfiles")
}

equals(TEMPLATE, app)|equals(TEMPLATE, lib) {
!contains(INSTALLS, target) {
!install_ok: \
error("$$_PRO_FILE_ is lacking an install target.")
else: check_examples: \
warning("$$_PRO_FILE_ is lacking an install target.")
} else: !equals(target.path, $$sources.path) {
!install_ok: \
error("$$_PRO_FILE_ installs target to unexpected location.")
else: check_examples: \
warning("$$_PRO_FILE_ installs target to unexpected location.")
}
equals(TEMPLATE, app)|equals(TEMPLATE, lib) {
!contains(INSTALLS, target) {
!install_ok: \
error("$$_PRO_FILE_ is lacking an install target.")
else: check_examples: \
warning("$$_PRO_FILE_ is lacking an install target.")
} else: !equals(target.path, $$sources.path) {
!install_ok: \
error("$$_PRO_FILE_ installs target to unexpected location.")
else: check_examples: \
warning("$$_PRO_FILE_ installs target to unexpected location.")
}
}

!equals(TEMPLATE, subdirs):!compile_examples {
TEMPLATE = aux
CONFIG -= have_target qt staticlib dll
SOURCES =
OBJECTIVE_SOURCES =
INSTALLS -= target
} else {
CONFIG += relative_qt_rpath # Examples built as part of Qt should be relocatable
}
!equals(TEMPLATE, subdirs):!compile_examples {
TEMPLATE = aux
CONFIG -= have_target qt staticlib dll
SOURCES =
OBJECTIVE_SOURCES =
INSTALLS -= target
} else {
CONFIG += relative_qt_rpath # Examples built as part of Qt should be relocatable
}
22 changes: 14 additions & 8 deletions mkspecs/features/toolchain.prf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ defineReplace(qtMakeExpand) {
}
}

defineTest(qtCompilerErrror) {
!cross_compile: \
what =
else: host_build: \
what = " host"
else: \
what = " target"
error("Cannot run$$what compiler '$$1'. Maybe you forgot to setup the environment?")
}

cross_compile:host_build: \
target_prefix = QMAKE_HOST_CXX
else: \
Expand Down Expand Up @@ -58,8 +68,7 @@ isEmpty($${target_prefix}.INCDIRS) {
cxx_flags += -E -v

output = $$system("$$cmd_prefix $$QMAKE_CXX $$qtMakeExpand($$cxx_flags) -xc++ - 2>&1 $$cmd_suffix", lines, ec)
!equals(ec, 0): \
error("Cannot run compiler '$$QMAKE_CXX'. Maybe you forgot to setup the environment?")
!equals(ec, 0): qtCompilerErrror($$QMAKE_CXX)

rim_qcc {
for (line, output) {
Expand Down Expand Up @@ -119,8 +128,7 @@ isEmpty($${target_prefix}.INCDIRS) {
# What's more, -print-search-dirs can't be used on clang on Apple because it
# won't print all the library paths (only the clang-internal ones).
output = $$system("$$cmd_prefix $$QMAKE_CXX -print-search-dirs", lines, ec)
!equals(ec, 0): \
error("Cannot run compiler '$$QMAKE_CXX'. Maybe you forgot to setup the environment?")
!equals(ec, 0): qtCompilerErrror($$QMAKE_CXX)

for (line, output) {
contains(line, "^libraries: .*") {
Expand Down Expand Up @@ -162,17 +170,15 @@ isEmpty($${target_prefix}.INCDIRS) {

defineReplace(qtVariablesFromMSVC) {
ret = $$system("$$1 -nologo -E $$2 $$system_quote($$PWD/data/macros.cpp) <NUL 2>NUL", lines, ec)
!equals(ec, 0): \
error("Cannot run compiler '$$1'. Maybe you forgot to setup the environment?")
!equals(ec, 0): qtCompilerErrror($$1)
return($$ret)
}

defineReplace(qtVariablesFromGCC) {
null_device = /dev/null
equals(QMAKE_HOST.os, Windows): null_device = NUL
ret = $$system("$$1 -E $$system_quote($$PWD/data/macros.cpp) <$$null_device 2>$$null_device", lines, ec)
!equals(ec, 0): \
error("Cannot run compiler '$$1'. Maybe you forgot to setup the environment?")
!equals(ec, 0): qtCompilerErrror($$1)
return($$ret)
}

Expand Down
6 changes: 4 additions & 2 deletions mkspecs/win32-g++/qmake.conf
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,10 @@ QMAKE_LFLAGS_CONSOLE = -Wl,-subsystem,console
QMAKE_LFLAGS_WINDOWS = -Wl,-subsystem,windows
QMAKE_LFLAGS_DLL = -shared
QMAKE_LFLAGS_GCSECTIONS = -Wl,--gc-sections
QMAKE_LINK_OBJECT_MAX = 10
QMAKE_LINK_OBJECT_SCRIPT = object_script
equals(QMAKE_HOST.os, Windows) {
QMAKE_LINK_OBJECT_MAX = 10
QMAKE_LINK_OBJECT_SCRIPT = object_script
}
QMAKE_PREFIX_SHLIB =
QMAKE_EXTENSION_SHLIB = dll
QMAKE_PREFIX_STATICLIB = lib
Expand Down
3 changes: 2 additions & 1 deletion qmake/generators/win32/mingw_make.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,8 @@ void MingwMakefileGenerator::writeLibsPart(QTextStream &t)

void MingwMakefileGenerator::writeObjectsPart(QTextStream &t)
{
if (project->values("OBJECTS").count() < var("QMAKE_LINK_OBJECT_MAX").toInt()) {
const ProString &objmax = project->first("QMAKE_LINK_OBJECT_MAX");
if (objmax.isEmpty() || project->values("OBJECTS").count() < objmax.toInt()) {
objectsLinkLine = "$(OBJECTS)";
} else if (project->isActiveConfig("staticlib") && project->first("TEMPLATE") == "lib") {
QString ar_script_file = var("QMAKE_LINK_OBJECT_SCRIPT") + "." + var("TARGET");
Expand Down
5 changes: 3 additions & 2 deletions qmake/library/proitems.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -477,9 +477,10 @@ bool ProStringList::contains(const char *str, Qt::CaseSensitivity cs) const
return false;
}

ProFile::ProFile(const QString &fileName)
ProFile::ProFile(int id, const QString &fileName)
: m_refCount(1),
m_fileName(fileName),
m_id(id),
m_ok(true),
m_hostBuild(false)
{
Expand All @@ -496,7 +497,7 @@ ProString ProFile::getStr(const ushort *&tPtr)
{
uint len = *tPtr++;
ProString ret(items(), tPtr - tokPtr(), len);
ret.setSource(this);
ret.setSource(m_id);
tPtr += len;
return ret;
}
Expand Down
10 changes: 6 additions & 4 deletions qmake/library/proitems.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ class ProString {
void setValue(const QString &str);
void clear() { m_string.clear(); m_length = 0; }
ProString &setSource(const ProString &other) { m_file = other.m_file; return *this; }
ProString &setSource(const ProFile *pro) { m_file = pro; return *this; }
const ProFile *sourceFile() const { return m_file; }
ProString &setSource(int id) { m_file = id; return *this; }
int sourceFile() const { return m_file; }

ProString &prepend(const ProString &other);
ProString &append(const ProString &other, bool *pending = 0);
Expand Down Expand Up @@ -164,7 +164,7 @@ class ProString {

QString m_string;
int m_offset, m_length;
const ProFile *m_file;
int m_file;
mutable uint m_hash;
QChar *prepareExtend(int extraLen, int thisTarget, int extraTarget);
uint updatedHash() const;
Expand Down Expand Up @@ -341,9 +341,10 @@ enum ProToken {
class QMAKE_EXPORT ProFile
{
public:
explicit ProFile(const QString &fileName);
ProFile(int id, const QString &fileName);
~ProFile();

int id() const { return m_id; }
QString fileName() const { return m_fileName; }
QString directoryName() const { return m_directoryName; }
const QString &items() const { return m_proitems; }
Expand All @@ -368,6 +369,7 @@ class QMAKE_EXPORT ProFile
QString m_proitems;
QString m_fileName;
QString m_directoryName;
int m_id;
bool m_ok;
bool m_hostBuild;
};
Expand Down
Loading

0 comments on commit 106d3b9

Please sign in to comment.