summaryrefslogtreecommitdiffstats
path: root/qmake
diff options
context:
space:
mode:
Diffstat (limited to 'qmake')
-rw-r--r--qmake/CMakeLists.txt3
-rw-r--r--qmake/doc/qmake.qdocconf2
-rw-r--r--qmake/doc/snippets/code/doc_src_qmake-manual.pro17
-rw-r--r--qmake/doc/src/qmake-manual.qdoc59
-rw-r--r--qmake/generators/makefiledeps.cpp25
-rw-r--r--qmake/generators/win32/msbuild_objectmodel.cpp4
-rw-r--r--qmake/generators/win32/msvc_objectmodel.cpp60
-rw-r--r--qmake/generators/win32/msvc_objectmodel.h4
8 files changed, 146 insertions, 28 deletions
diff --git a/qmake/CMakeLists.txt b/qmake/CMakeLists.txt
index 30e00991b1..5b6541da11 100644
--- a/qmake/CMakeLists.txt
+++ b/qmake/CMakeLists.txt
@@ -1,3 +1,6 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
+
# Generated from qmake.pro.
#####################################################################
diff --git a/qmake/doc/qmake.qdocconf b/qmake/doc/qmake.qdocconf
index f3e5c1920a..f0ab617801 100644
--- a/qmake/doc/qmake.qdocconf
+++ b/qmake/doc/qmake.qdocconf
@@ -24,6 +24,8 @@ exampledirs = snippets
tagfile = qmake.tags
+macro.qtbug = "\\l{https://bugreports.qt.io/browse/\1}{\1}"
+
depends += \
activeqt \
qt3d \
diff --git a/qmake/doc/snippets/code/doc_src_qmake-manual.pro b/qmake/doc/snippets/code/doc_src_qmake-manual.pro
index e82799c5bf..76f0eec2fe 100644
--- a/qmake/doc/snippets/code/doc_src_qmake-manual.pro
+++ b/qmake/doc/snippets/code/doc_src_qmake-manual.pro
@@ -944,3 +944,20 @@ win32-g++:contains(QMAKE_HOST.arch, x86_64):{
...
}
#! [187]
+
+#! [188]
+translations_en.files = $$PWD/en.lproj/InfoPlist.strings
+translations_en.path = en.lproj
+QMAKE_BUNDLE_DATA += translations_en
+#! [188]
+
+#! [189]
+# Approach 1
+translations_en.files = $$PWD/InfoPlist.strings
+translations_en.path = en.lproj
+
+# Approach 2
+translations_de.files = $$PWD/de.lproj/InfoPlist.strings
+
+QMAKE_BUNDLE_DATA += translations_en translations_de
+#! [189]
diff --git a/qmake/doc/src/qmake-manual.qdoc b/qmake/doc/src/qmake-manual.qdoc
index a8002d816e..41611be0e5 100644
--- a/qmake/doc/src/qmake-manual.qdoc
+++ b/qmake/doc/src/qmake-manual.qdoc
@@ -1203,8 +1203,10 @@
By default, support is disabled.
\row \li c++2a \li Obsolete alias for c++20.
\row \li c++latest \li Support for the latest C++ language standard is
- enabled that is supported by the compiler. By default, this option is
- disabled.
+ enabled. This option is mostly useful for MSVC that supports a
+ \c{/std:c++latest} compiler argument. For other toolchains, this
+ option enables the latest C++ standard that is known to Qt. By
+ default, this option is disabled.
\row \li strict_c++ \li Disables support for C++ compiler extensions.
By default, they are enabled.
\row \li depend_includepath \li Appending the value of INCLUDEPATH to
@@ -1827,9 +1829,33 @@
\target QML_IMPORT_PATH
\section1 QML_IMPORT_PATH
- This variable is only used by \l{Qt Creator Manual}{Qt Creator}.
+ This variable is only used by \l{Qt Creator Manual}{Qt Creator}. If you have
+ an extra module that is kept outside of your Qt installation, you can
+ specify its path here.
+
See \l{Qt Creator: Using QML Modules with Plugins} for details.
+ \target QMLPATHS
+ \section1 QMLPATHS
+
+ Expects a list of import paths that point to root directories of trees of
+ QML modules. For example, if you have a custom location for your QML
+ modules, you can specify it here.
+
+ \note The path entries for QMLPATHS point to root directories of trees of
+ QML modules. This is the concept of import paths the QML engine understands.
+ You can pass the same paths via the \c QML_IMPORT_PATH \e environment variable
+ to your QML application, but they are \e different from the expected contents
+ of the \l QML_IMPORT_PATH \e qmake variable. The latter expects paths to
+ \e individual modules to be processed by Qt Creator only.
+
+ \note The contents of QMLPATHS are \e not automatically passed to your
+ application. Rather, they are only used at build time. In particular,
+ qmlimportscanner uses them to find any QML modules it may need to mark as
+ imported by your application.
+
+ \sa QQmlEngine::addImportPath()
+
\target QMAKE_systemvariable
\section1 QMAKE
@@ -1876,6 +1902,33 @@
See \l{Platform Notes#Creating Frameworks}{Platform Notes} for
more information about creating library bundles.
+ A project can also use this variable to bundle application translation
+ files. The exact syntax depends on whether the project is using Xcode's
+ legacy build system or its new build system.
+
+ For example when the following project snippet is built using the
+ legacy build system:
+
+ \snippet code/doc_src_qmake-manual.pro 188
+
+ Xcode will ignore the original location of \c InfoPlist.strings
+ and the file will placed into the bundle \c Resources directory
+ under the provided \c translations_en.path path, so
+ \c Resources/en.lproj/InfoPlist.strings
+
+ With the new build system, the relative location of the file is
+ preserved, which means the file will incorrectly be placed under
+ \c Resources/en.lproj/en.lproj/InfoPlist.strings
+
+ To ensure correct file placement, the project can either move
+ the original file not to be in a sub-directory or it can choose
+ not to specify the \c translations_en.path variable.
+
+ \snippet code/doc_src_qmake-manual.pro 189
+
+ See \qtbug QTBUG-98417 for more details on how the Xcode build
+ system changed its behavior in bundling translation files.
+
\section1 QMAKE_BUNDLE_EXTENSION
\note This variable is used on \macos, iOS, tvOS, and watchOS only.
diff --git a/qmake/generators/makefiledeps.cpp b/qmake/generators/makefiledeps.cpp
index 0646d232ce..c8f4772dcb 100644
--- a/qmake/generators/makefiledeps.cpp
+++ b/qmake/generators/makefiledeps.cpp
@@ -365,13 +365,21 @@ static bool matchWhileUnsplitting(const char *buffer, int buffer_len, int start,
return true;
}
-/* Advance from an opening quote at buffer[offset] to the matching close quote. */
+/* Advance from an opening quote at buffer[offset] to the matching close quote.
+ If an apostrophe turns out to be a digit-separator in a numeric literal,
+ rather than the start of a character literal, treat it as both the open and
+ the close quote of the "string" that isn't there.
+*/
static int scanPastString(char *buffer, int buffer_len, int offset, int *lines)
{
// http://en.cppreference.com/w/cpp/language/string_literal
// It might be a C++11 raw string.
bool israw = false;
- if (buffer[offset] == '"' && offset > 0) {
+
+ Q_ASSERT(offset < buffer_len);
+ if (offset <= 0) {
+ // skip, neither of these special cases applies here
+ } else if (buffer[offset] == '"') {
int explore = offset - 1;
bool prefix = false; // One of L, U, u or u8 may appear before R
bool saw8 = false; // Partial scan of u8
@@ -415,6 +423,19 @@ static int scanPastString(char *buffer, int buffer_len, int offset, int *lines)
&& (isalnum(buffer[explore]) || buffer[explore] == '_')) {
israw = false;
}
+
+ } else {
+ // Is this apostrophe a digit separator rather than the start of a
+ // character literal ? If so, there was no string to scan past, so
+ // treat the apostrophe as both open and close.
+ Q_ASSERT(buffer[offset] == '\'' && offset > 0);
+ // Wrap std::isdigit() to package the casting to unsigned char.
+ const auto isDigit = [](unsigned char c) { return std::isdigit(c); };
+ if (isDigit(buffer[offset - 1]) && offset + 1 < buffer_len && isDigit(buffer[offset + 1])) {
+ // One exception: u8'0' is a perfectly good character literal.
+ if (offset < 2 || buffer[offset - 1] != '8' || buffer[offset - 2] != 'u')
+ return offset;
+ }
}
if (israw) {
diff --git a/qmake/generators/win32/msbuild_objectmodel.cpp b/qmake/generators/win32/msbuild_objectmodel.cpp
index d504ea5195..ba3bc37088 100644
--- a/qmake/generators/win32/msbuild_objectmodel.cpp
+++ b/qmake/generators/win32/msbuild_objectmodel.cpp
@@ -1064,6 +1064,8 @@ static inline QString toString(optLinkTimeCodeGenType option)
break;
case optLTCGEnabled:
return "UseLinkTimeCodeGeneration";
+ case optLTCGIncremental:
+ return "UseFastLinkTimeCodeGeneration";
case optLTCGInstrument:
return "PGInstrument";
case optLTCGOptimize:
@@ -1097,6 +1099,8 @@ static inline QString toString(triState genDebugInfo, linkerDebugOption option)
case _True:
if (option == linkerDebugOptionFastLink)
return "DebugFastLink";
+ else if (option == linkerDebugOptionFull)
+ return "DebugFull";
return "true";
}
return QString();
diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp
index af6d4a224b..62214bb66a 100644
--- a/qmake/generators/win32/msvc_objectmodel.cpp
+++ b/qmake/generators/win32/msvc_objectmodel.cpp
@@ -383,7 +383,7 @@ VCCLCompilerTool::VCCLCompilerTool()
CompileForArchitecture(archUnknown),
InterworkCalls(unset),
EnablePREfast(unset),
- DisplayFullPaths(unset),
+ DisplayFullPaths(_False),
MultiProcessorCompilation(unset),
GenerateXMLDocumentationFiles(unset),
CreateHotpatchableImage(unset)
@@ -1477,10 +1477,22 @@ bool VCLinkerTool::parseOption(const char* option)
}else
EnableUAC = _True;
break;
- case 0x3389797: // /DEBUG[:FASTLINK]
- GenerateDebugInformation = _True;
- if (config->CompilerVersion >= NET2015 && strcmp(option + 7, "FASTLINK") == 0)
- DebugInfoOption = linkerDebugOptionFastLink;
+ case 0x3389797: // /DEBUG[:{FASTLINK|FULL|NONE}]
+ if (config->CompilerVersion >= NET2015) {
+ const char *str = option + 7;
+ if (qstricmp(str, "fastlink") == 0)
+ DebugInfoOption = linkerDebugOptionFastLink;
+ else if (qstricmp(str, "full") == 0)
+ DebugInfoOption = linkerDebugOptionFull;
+ else if (qstricmp(str, "none") == 0)
+ DebugInfoOption = linkerDebugOptionNone;
+ else
+ AdditionalOptions += option;
+ }
+ if (DebugInfoOption == linkerDebugOptionNone)
+ GenerateDebugInformation = _False;
+ else
+ GenerateDebugInformation = _True;
break;
case 0x0033896: // /DEF:filename
ModuleDefinitionFile = option+5;
@@ -1567,24 +1579,28 @@ bool VCLinkerTool::parseOption(const char* option)
case 0x0d745c8: // /LIBPATH:dir
AdditionalLibraryDirectories += option+9;
break;
- case 0x0341877: // /LTCG[:NOSTATUS|:STATUS]
- config->WholeProgramOptimization = _True;
- if (config->CompilerVersion >= NET2005) {
- LinkTimeCodeGeneration = optLTCGEnabled;
- if(*(option+5) == ':') {
- const char* str = option+6;
- if (*str == 'S')
- ShowProgress = linkProgressAll;
- else if (qstricmp(str, "pginstrument") == 0)
- LinkTimeCodeGeneration = optLTCGInstrument;
- else if (qstricmp(str, "pgoptimize") == 0)
- LinkTimeCodeGeneration = optLTCGOptimize;
- else if (qstricmp(str, "pgupdate") == 0)
- LinkTimeCodeGeneration = optLTCGUpdate;
- }
- } else {
- AdditionalOptions.append(option);
+ case 0x0341877: // /LTCG[:{INCREMENTAL|NOSTATUS|STATUS|OFF}]
+ // /LTCG:{PGINSTRUMENT|PGOPTIMIZE|PGUPDATE}
+ LinkTimeCodeGeneration = optLTCGEnabled;
+ if (*(option + 5) == ':') {
+ const char* str = option + 6;
+ if (qstricmp(str, "status") == 0)
+ ShowProgress = linkProgressAll;
+ else if (qstricmp(str, "off") == 0)
+ LinkTimeCodeGeneration = optLTCGDefault;
+ else if (qstricmp(str, "incremental") == 0)
+ LinkTimeCodeGeneration = optLTCGIncremental;
+ else if (qstricmp(str, "pginstrument") == 0)
+ LinkTimeCodeGeneration = optLTCGInstrument;
+ else if (qstricmp(str, "pgoptimize") == 0)
+ LinkTimeCodeGeneration = optLTCGOptimize;
+ else if (qstricmp(str, "pgupdate") == 0)
+ LinkTimeCodeGeneration = optLTCGUpdate;
+ else
+ AdditionalOptions.append(option);
}
+ if (LinkTimeCodeGeneration != optLTCGDefault)
+ config->WholeProgramOptimization = _True;
break;
case 0x379ED25:
case 0x157cf65: // /MACHINE:{AM33|ARM|CEE|IA64|X86|M32R|MIPS|MIPS16|MIPSFPU|MIPSFPU16|MIPSR41XX|PPC|SH3|SH4|SH5|THUMB|TRICORE}
diff --git a/qmake/generators/win32/msvc_objectmodel.h b/qmake/generators/win32/msvc_objectmodel.h
index 682dec018f..f0869d510f 100644
--- a/qmake/generators/win32/msvc_objectmodel.h
+++ b/qmake/generators/win32/msvc_objectmodel.h
@@ -258,7 +258,8 @@ enum inlineExpansionOption {
};
enum linkerDebugOption {
linkerDebugOptionNone,
- linkerDebugOptionFastLink
+ linkerDebugOptionFastLink,
+ linkerDebugOptionFull
};
enum linkIncrementalType {
linkIncrementalDefault,
@@ -331,6 +332,7 @@ enum optWin98Type {
enum optLinkTimeCodeGenType {
optLTCGDefault,
optLTCGEnabled,
+ optLTCGIncremental,
optLTCGInstrument,
optLTCGOptimize,
optLTCGUpdate