summaryrefslogtreecommitdiffstats
path: root/qmake
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2016-08-22 11:30:00 +0200
committerOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2016-08-22 11:30:01 +0200
commitd314819fc02139e05e16c56657898c704f7fb48f (patch)
treea61ba968233634948401c8339f9613844de1c2b5 /qmake
parent9f888d2fde9c5413e5519e0914e9b13638760985 (diff)
parente0e9e196a72ffe5457034894eaaadc90ed0d34ef (diff)
Merge dev into 5.8
Diffstat (limited to 'qmake')
-rw-r--r--qmake/doc/src/qmake-manual.qdoc53
-rw-r--r--qmake/generators/mac/pbuilder_pbx.cpp2
-rw-r--r--qmake/generators/win32/msvc_nmake.cpp6
-rw-r--r--qmake/library/qmakebuiltins.cpp23
-rw-r--r--qmake/library/qmakeevaluator.h2
5 files changed, 55 insertions, 31 deletions
diff --git a/qmake/doc/src/qmake-manual.qdoc b/qmake/doc/src/qmake-manual.qdoc
index 4d958b1a20..509dc3efa1 100644
--- a/qmake/doc/src/qmake-manual.qdoc
+++ b/qmake/doc/src/qmake-manual.qdoc
@@ -28,7 +28,7 @@
/*!
\page qmake-manual.html
\title qmake Manual
- \startpage {Qt Reference Documentation}
+ \startpage index.html
\nextpage Overview
\ingroup qttools
@@ -657,7 +657,7 @@
qmake knows about many of these features, which can be accessed via specific
variables that only take effect on the platforms where they are relevant.
- \section1 OS X, iOS and tvOS
+ \section1 \macos, iOS, tvOS, and watchOS
Features specific to these platforms include support for creating universal
binaries, frameworks and bundles.
@@ -681,7 +681,7 @@
qmake is able to automatically generate build
rules for linking against frameworks in the standard framework directory on
- OS X, located at \c{/Library/Frameworks/}.
+ \macos, located at \c{/Library/Frameworks/}.
Directories other than the standard framework directory need to be specified
to the build system, and this is achieved by appending linker options to the
@@ -722,13 +722,13 @@
and \l{QMAKE_FRAMEWORK_VERSION} variables. By default, the values used for
these variables are obtained from the \l{TARGET} and \l{VERSION} variables.
- See \l{Qt for OS X - Deployment} for more information about
+ See \l{Qt for macOS - Deployment} for more information about
deploying applications and libraries.
\section2 Creating and Moving Xcode Projects
- Developers on OS X can take advantage of the qmake support for Xcode
- project files, as described in \l{Qt for OS X#Additional Command-Line Options}{Qt for OS X} documentation.
+ Developers on \macos can take advantage of the qmake support for Xcode
+ project files, as described in \l{Qt for macOS#Additional Command-Line Options}{Qt for \macos} documentation.
by running qmake to generate an Xcode project from an existing qmake project
file. For example:
@@ -1069,7 +1069,7 @@
See \l{Platform Notes#Visual Studio Manifest Files}{Platform Notes}
for more information about the options for embedding manifest files.
- The following options take an effect only on OS X:
+ The following options take an effect only on \macos:
\table
\header \li Option \li Description
@@ -1439,7 +1439,7 @@
\target QMAKE_BUNDLE_DATA
\section1 QMAKE_BUNDLE_DATA
- \note This variable is used on OS X, iOS and tvOS only.
+ \note This variable is used on \macos, iOS, tvOS, and watchOS only.
Specifies the data that will be installed with a library
bundle, and is often used to specify a collection of header files.
@@ -1461,7 +1461,7 @@
\section1 QMAKE_BUNDLE_EXTENSION
- \note This variable is used on OS X, iOS and tvOS only.
+ \note This variable is used on \macos, iOS, tvOS, and watchOS only.
Specifies the extension to be used for library bundles.
This allows frameworks to be created with custom extensions instead of the
@@ -1695,7 +1695,7 @@
\section1 QMAKE_FRAMEWORK_BUNDLE_NAME
- \note This variable is used on OS X, iOS and tvOS only.
+ \note This variable is used on \macos, iOS, tvOS, and watchOS only.
In a framework project, this variable contains the name to be used for the
framework that is built.
@@ -1709,9 +1709,9 @@
\target QMAKE_FRAMEWORK_VERSION
\section1 QMAKE_FRAMEWORK_VERSION
- \note This variable is used on OS X, iOS and tvOS only.
+ \note This variable is used on \macos, iOS, tvOS, and watchOS only.
- For projects where the build target is an OS X, iOS or tvOS framework, this
+ For projects where the build target is an \macos, iOS, tvOS, or watchOS framework, this
variable is used to specify the version number that will be applied to the
framework that is built.
@@ -1804,10 +1804,10 @@
\target QMAKE_INFO_PLIST
\section1 QMAKE_INFO_PLIST
- \note This variable is used on OS X, iOS and tvOS platforms only.
+ \note This variable is used on \macos, iOS, tvOS, and watchOS platforms only.
Specifies the name of the property list file, \c{.plist}, you
- would like to include in your OS X, iOS and tvOS application bundle.
+ would like to include in your \macos, iOS, tvOS, and watchOS application bundle.
In the \c{.plist} file, you can define some variables, e.g., @EXECUTABLE@,
which qmake will replace with the actual executable name. Other variables
@@ -2077,16 +2077,16 @@
\section1 QMAKE_MAC_SDK
- This variable is used on OS X when building universal binaries.
+ This variable is used on \macos when building universal binaries.
\section1 QMAKE_MACOSX_DEPLOYMENT_TARGET
- This variable only takes effect when building on OS X. On that
+ This variable only takes effect when building on \macos. On that
platform, the variable will be forwarded to the MACOSX_DEPLOYMENT_TARGET
environment variable, which is interpreted by the compiler or linker.
For more information, see the
- \l{Qt for OS X - Deployment#OS X Version Dependencies}{Deploying
- an Application on OS X} document.
+ \l{Qt for macOS - Deployment#macOS Version Dependencies}{Deploying
+ an Application on \macos} document.
\section1 QMAKE_MAKEFILE
@@ -2164,8 +2164,8 @@
If defined, the value of this variable is used as a path to be prepended to
the built shared library's \c SONAME identifier. The \c SONAME is the
identifier that the dynamic linker will later use to reference the library.
- In general this reference may be a library name or full library path. On OS
- X, iOS and tvOS, the path may be specified relatively using the following
+ In general this reference may be a library name or full library path. On \macos,
+ iOS, tvOS, and watchOS, the path may be specified relatively using the following
placeholders:
\table
@@ -3138,7 +3138,7 @@
See also \l{fn_size}{size()}.
- \section2 system(command[, mode])
+ \section2 system(command[, mode[, stsvar]])
You can use this variant of the \c system function to obtain stdout from the
command and assign it to a variable.
@@ -3147,6 +3147,11 @@
\snippet code/doc_src_qmake-manual.pro 72
+ If you pass \c stsvar, the command's exit status will be stored in that
+ variable. If the command crashes, the status will be -1, otherwise a
+ non-negative exit code of the command's choosing. Usually, comparing
+ the status with zero (success) is sufficient.
+
See also the test variant of \l{system(command)}{system()}.
\section2 system_path(path)
@@ -4423,7 +4428,7 @@
\li nmake
\li Visual Studio projects (VS 2008 and later)
\endlist
- \li OS X, iOS and tvOS
+ \li \macos, iOS, tvOS, and watchOS
\list
\li Makefile
\li Xcode
@@ -4794,7 +4799,7 @@
them uses project-specific variables to customize output files.
Platform-specific variables are not described here. For more information,
- see \l{Qt for Windows - Deployment} and \l{Qt for OS X}.
+ see \l{Qt for Windows - Deployment} and \l{Qt for macOS}.
\target Application
\section1 Building an Application
@@ -4942,7 +4947,7 @@
\endlist
The target file name for the library is platform-dependent. For example, on
- X11, OS X, and iOS, the library name will be prefixed by \c lib. On Windows,
+ X11, \macos, and iOS, the library name will be prefixed by \c lib. On Windows,
no prefix is added to the file name.
\target Plugin
diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp
index 47c7826154..bf2e774678 100644
--- a/qmake/generators/mac/pbuilder_pbx.cpp
+++ b/qmake/generators/mac/pbuilder_pbx.cpp
@@ -1537,6 +1537,8 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
t << "\t\t\t\t" << writeSettings("IPHONEOS_DEPLOYMENT_TARGET", project->first("QMAKE_IOS_DEPLOYMENT_TARGET")) << ";\n";
if (!project->isEmpty("QMAKE_TVOS_DEPLOYMENT_TARGET"))
t << "\t\t\t\t" << writeSettings("APPLETVOS_DEPLOYMENT_TARGET", project->first("QMAKE_TVOS_DEPLOYMENT_TARGET")) << ";\n";
+ if (!project->isEmpty("QMAKE_WATCHOS_DEPLOYMENT_TARGET"))
+ t << "\t\t\t\t" << writeSettings("WATCHOS_DEPLOYMENT_TARGET", project->first("QMAKE_WATCHOS_DEPLOYMENT_TARGET")) << ";\n";
if (!project->isEmpty("QMAKE_XCODE_CODE_SIGN_IDENTITY"))
t << "\t\t\t\t" << writeSettings("CODE_SIGN_IDENTITY", project->first("QMAKE_XCODE_CODE_SIGN_IDENTITY")) << ";\n";
diff --git a/qmake/generators/win32/msvc_nmake.cpp b/qmake/generators/win32/msvc_nmake.cpp
index 58d6ecf110..029092fdaa 100644
--- a/qmake/generators/win32/msvc_nmake.cpp
+++ b/qmake/generators/win32/msvc_nmake.cpp
@@ -391,6 +391,12 @@ void NmakeMakefileGenerator::init()
if (!defines.contains("NDEBUG"))
defines.append("NDEBUG");
}
+
+ if (project->values("QMAKE_APP_FLAG").isEmpty() && project->isActiveConfig("dll")) {
+ ProStringList &defines = project->values("DEFINES");
+ if (!defines.contains("_WINDLL"))
+ defines.append("_WINDLL");
+ }
}
QStringList NmakeMakefileGenerator::sourceFilesForImplicitRulesFilter()
diff --git a/qmake/library/qmakebuiltins.cpp b/qmake/library/qmakebuiltins.cpp
index 616b05e82d..ba621c1c72 100644
--- a/qmake/library/qmakebuiltins.cpp
+++ b/qmake/library/qmakebuiltins.cpp
@@ -450,12 +450,13 @@ void QMakeEvaluator::runProcess(QProcess *proc, const QString &command) const
}
#endif
-QByteArray QMakeEvaluator::getCommandOutput(const QString &args) const
+QByteArray QMakeEvaluator::getCommandOutput(const QString &args, int *exitCode) const
{
QByteArray out;
#ifndef QT_BOOTSTRAPPED
QProcess proc;
runProcess(&proc, args);
+ *exitCode = (proc.exitStatus() == QProcess::NormalExit) ? proc.exitCode() : -1;
QByteArray errout = proc.readAllStandardError();
# ifdef PROEVALUATOR_FULL
// FIXME: Qt really should have the option to set forwarding per channel
@@ -483,7 +484,12 @@ QByteArray QMakeEvaluator::getCommandOutput(const QString &args) const
break;
out += QByteArray(buff, read_in);
}
- QT_PCLOSE(proc);
+ int ec = QT_PCLOSE(proc);
+# ifdef Q_OS_WIN
+ *exitCode = ec >= 0 ? ec : -1;
+# else
+ *exitCode = WIFEXITED(ec) ? WEXITSTATUS(ec) : -1;
+# endif
}
# ifdef Q_OS_WIN
out.replace("\r\n", "\n");
@@ -871,8 +877,8 @@ ProStringList QMakeEvaluator::evaluateBuiltinExpand(
break;
case E_SYSTEM:
if (!m_skipLevel) {
- if (args.count() < 1 || args.count() > 2) {
- evalError(fL1S("system(execute) requires one or two arguments."));
+ if (args.count() < 1 || args.count() > 3) {
+ evalError(fL1S("system(command, [mode], [stsvar]) requires one to three arguments."));
} else {
bool blob = false;
bool lines = false;
@@ -885,7 +891,12 @@ ProStringList QMakeEvaluator::evaluateBuiltinExpand(
else if (!args.at(1).compare(QLatin1String("lines"), Qt::CaseInsensitive))
lines = true;
}
- QByteArray bytes = getCommandOutput(args.at(0).toQString(m_tmp2));
+ int exitCode;
+ QByteArray bytes = getCommandOutput(args.at(0).toQString(m_tmp2), &exitCode);
+ if (args.count() > 2 && !args.at(2).isEmpty()) {
+ m_valuemapStack.top()[args.at(2).toKey()] =
+ ProStringList(ProString(QString::number(exitCode)));
+ }
if (lines) {
QTextStream stream(bytes);
while (!stream.atEnd())
@@ -1587,7 +1598,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
#ifdef PROEVALUATOR_FULL
fputs(msg.toLatin1().constData(), stderr);
#endif
- } else {
+ } else if (!msg.isEmpty() || func_t != T_ERROR) {
m_handler->fileMessage(
(func_t == T_ERROR ? QMakeHandler::ErrorMessage :
func_t == T_WARNING ? QMakeHandler::WarningMessage :
diff --git a/qmake/library/qmakeevaluator.h b/qmake/library/qmakeevaluator.h
index eddabe39a0..3f2a22c567 100644
--- a/qmake/library/qmakeevaluator.h
+++ b/qmake/library/qmakeevaluator.h
@@ -240,7 +240,7 @@ public:
#ifndef QT_BOOTSTRAPPED
void runProcess(QProcess *proc, const QString &command) const;
#endif
- QByteArray getCommandOutput(const QString &args) const;
+ QByteArray getCommandOutput(const QString &args, int *exitCode) const;
QMakeEvaluator *m_caller;
#ifdef PROEVALUATOR_CUMULATIVE