summaryrefslogtreecommitdiffstats
path: root/qmake
diff options
context:
space:
mode:
Diffstat (limited to 'qmake')
-rw-r--r--qmake/doc/snippets/code/doc_src_qmake-manual.pro4
-rw-r--r--qmake/doc/snippets/qmake/scopes.pro18
-rw-r--r--qmake/doc/src/qmake-manual.qdoc44
-rw-r--r--qmake/generators/makefile.cpp2
4 files changed, 59 insertions, 9 deletions
diff --git a/qmake/doc/snippets/code/doc_src_qmake-manual.pro b/qmake/doc/snippets/code/doc_src_qmake-manual.pro
index 8ba0aa0713..d36d926b66 100644
--- a/qmake/doc/snippets/code/doc_src_qmake-manual.pro
+++ b/qmake/doc/snippets/code/doc_src_qmake-manual.pro
@@ -303,7 +303,9 @@ SUBDIRS = kernel \
#! [51]
-CONFIG += ordered
+SUBDIRS += my_executable my_library tests doc
+my_executable.depends = my_library
+tests.depends = my_executable
#! [51]
diff --git a/qmake/doc/snippets/qmake/scopes.pro b/qmake/doc/snippets/qmake/scopes.pro
index 63b9b3aa55..6721937755 100644
--- a/qmake/doc/snippets/qmake/scopes.pro
+++ b/qmake/doc/snippets/qmake/scopes.pro
@@ -40,3 +40,21 @@ win32|macx {
HEADERS += debugging.h
}
#! [4]
+
+#! [5]
+if(win32|macos):CONFIG(debug, debug|release) {
+ # Do something on Windows and macOS,
+ # but only for the debug configuration.
+}
+win32|if(macos:CONFIG(debug, debug|release)) {
+ # Do something on Windows (regardless of debug or release)
+ # and on macOS (only for debug).
+}
+#! [5]
+
+#! [6]
+win32-* {
+ # Matches every mkspec starting with "win32-"
+ SOURCES += win32_specific.cpp
+}
+#! [6]
diff --git a/qmake/doc/src/qmake-manual.qdoc b/qmake/doc/src/qmake-manual.qdoc
index b002521a8e..bb7ad31f8d 100644
--- a/qmake/doc/src/qmake-manual.qdoc
+++ b/qmake/doc/src/qmake-manual.qdoc
@@ -936,7 +936,9 @@
file.
\row \li ordered \li When using the \c subdirs template, this option
specifies that the directories listed should be processed in the
- order in which they are given.
+ order in which they are given. \note The use of this option is discouraged.
+ Specify dependencies as described in the \l{#SUBDIRS}{SUBDIRS}
+ variable documentation.
\row \li precompile_header \li Enables support for the use of
\l{Using Precompiled Headers}{precompiled headers} in projects.
\row \li precompile_header_c (MSVC only) \li Enables support for the use of
@@ -2730,21 +2732,35 @@
\snippet code/doc_src_qmake-manual.pro 50
- If you need to ensure that the subdirectories are built in the order in
- which they are specified, update the \l{#CONFIG}{CONFIG} variable to
- include the \c ordered option:
+ If you need to ensure that the subdirectories are built in a particular
+ order, use the \c .depends modifier on the relevant \c SUBDIRS elements.
+
+ For example:
\snippet code/doc_src_qmake-manual.pro 51
- It is possible to modify this default behavior of \c SUBDIRS by giving
- additional modifiers to \c SUBDIRS elements. Supported modifiers are:
+ The configuration above ensures that \c{my_library} is built before
+ \c{my_executable} and that \c{my_executable} is built before \c{tests}.
+ However, \c{doc} can be built in parallel with the other subdirectories,
+ thus speeding up the build process.
+
+ \note Multiple dependencies can be listed and they will all be built before
+ the target that depends on them.
+
+ \note Using \l{#CONFIG}{CONFIG += ordered} is discouraged as it can slow down
+ multi-core builds. Unlike the example shown above, all builds will happen
+ sequentially even if they don't have dependencies.
+
+ Beside defining the build order, it is possible to modify the default behavior
+ of \c SUBDIRS by giving additional modifiers to \c SUBDIRS elements.
+ Supported modifiers are:
\table
\header \li Modifier \li Effect
\row \li .subdir \li Use the specified subdirectory instead of \c SUBDIRS value.
\row \li .file \li Specify the subproject \c pro file explicitly. Cannot be
used in conjunction with \c .subdir modifier.
- \row \li .depends \li This subproject depends on specified subproject.
+ \row \li .depends \li This subproject depends on specified subproject(s).
\row \li .makefile \li The makefile of subproject.
Available only on platforms that use makefiles.
\row \li .target \li Base string used for makefile targets related to this
@@ -4418,6 +4434,20 @@
\snippet qmake/scopes.pro 4
+ If you need to mix both operators, you can use the \c if function to specify
+ operator precedence.
+
+ \snippet qmake/scopes.pro 5
+
+ The condition accepts the wildcard character to match a family of \c{CONFIG}
+ values or mkspec names.
+
+ \snippet qmake/scopes.pro 6
+
+ \note Historically, checking the mkspec name with wildcards like above was
+ qmake's way to check for the platform. Nowadays, we recommend to use values
+ that are defined by the mkspec in the \c QMAKE_PLATFORM variable.
+
You can also provide alternative declarations to those within a scope by
using an \c else scope. Each \c else scope is processed if the conditions
for the preceding scopes are false.
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index dcb44239a0..7e471f126c 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -1520,7 +1520,7 @@ MakefileGenerator::createObjectList(const ProStringList &sources)
if (!noIO()) {
// Ensure that the final output directory of each object exists
QString outRelativePath = fileFixify(dir, FileFixifyBackwards);
- if (!mkdir(outRelativePath))
+ if (!outRelativePath.isEmpty() && !mkdir(outRelativePath))
warn_msg(WarnLogic, "Cannot create directory '%s'", outRelativePath.toLatin1().constData());
}
} else {