Merge remote-tracking branch 'origin/dev' into wip/cmake
Take 5. Change-Id: Ifb2d20e95ba824e45e667fba6c2ba45389991cc3
@ -1111,7 +1111,7 @@ foreach my $lib (@modules_to_sync) {
|
||||
elsif (!$shadow) {
|
||||
$pri_install_pfiles.= "$pri_install_iheader ";;
|
||||
}
|
||||
$pri_injections .= fixPaths($iheader, $out_basedir)
|
||||
$pri_injections .= fixPaths($iheader, $build_basedir)
|
||||
.":".($no_stamp ? "^" : "").fixPaths($oheader, "$out_basedir/include/$lib")
|
||||
.$injection." " if ($shadow);
|
||||
}
|
||||
|
@ -122,6 +122,7 @@ Build options:
|
||||
|
||||
-qtnamespace <name> .. Wrap all Qt library code in 'namespace <name> {...}'.
|
||||
-qtlibinfix <infix> .. Rename all libQt5*.so to libQt5*<infix>.so.
|
||||
-qtlibinfix-plugins .. Rename Qt plugins according to -qtlibinfix [no]
|
||||
|
||||
-testcocoon .......... Instrument with the TestCocoon code coverage tool [no]
|
||||
-gcov ................ Instrument with the GCov code coverage tool [no]
|
||||
@ -139,8 +140,8 @@ Build options:
|
||||
-coverage {trace-pc-guard}
|
||||
Add code coverage instrumentation (Clang only)
|
||||
|
||||
-c++std <edition> .... Select C++ standard <edition> [c++1z/c++14/c++11]
|
||||
(Not supported with MSVC)
|
||||
-c++std <edition> .... Select C++ standard <edition> [c++2a/c++17/c++14/c++11]
|
||||
(Not supported with MSVC 2015)
|
||||
|
||||
-sse2 ................ Use SSE2 instructions [auto]
|
||||
-sse3/-ssse3/-sse4.1/-sse4.2/-avx/-avx2/-avx512
|
||||
@ -203,7 +204,7 @@ Build environment:
|
||||
-android-ndk-host .... Set Android NDK host (linux-x86, linux-x86_64, etc.)
|
||||
[$ANDROID_NDK_HOST]
|
||||
-android-arch ........ Set Android architecture (armeabi, armeabi-v7a,
|
||||
arm64-v8a, x86, x86_64, mips, mips64)
|
||||
arm64-v8a, x86, x86_64)
|
||||
-android-toolchain-version ... Set Android toolchain version
|
||||
-android-style-assets Automatically extract style assets from the device at
|
||||
run time. This option makes the Android style behave
|
||||
|
@ -110,6 +110,7 @@
|
||||
"profile": "boolean",
|
||||
"qreal": "string",
|
||||
"qtlibinfix": { "type": "string", "name": "qt_libinfix" },
|
||||
"qtlibinfix-plugins": { "type": "boolean", "name": "qt_libinfix_plugins" },
|
||||
"qtnamespace": { "type": "string", "name": "qt_namespace" },
|
||||
"reduce-exports": { "type": "boolean", "name": "reduce_exports" },
|
||||
"reduce-relocations": { "type": "boolean", "name": "reduce_relocations" },
|
||||
@ -319,7 +320,7 @@
|
||||
}
|
||||
},
|
||||
"c++1z": {
|
||||
"label": "C++1z support",
|
||||
"label": "C++17 support",
|
||||
"type": "compile",
|
||||
"test": {
|
||||
"head": [
|
||||
@ -339,6 +340,20 @@
|
||||
"qmake": "CONFIG += c++11 c++14 c++1z"
|
||||
}
|
||||
},
|
||||
"c++2a": {
|
||||
"label": "C++2a support",
|
||||
"type": "compile",
|
||||
"test": {
|
||||
"head": [
|
||||
"#if __cplusplus > 201703L",
|
||||
"// Compiler claims to support experimental C++2a, trust it",
|
||||
"#else",
|
||||
"# error __cplusplus must be > 201703L (the value for C++17)",
|
||||
"#endif"
|
||||
],
|
||||
"qmake": "CONFIG += c++11 c++14 c++1z c++2a"
|
||||
}
|
||||
},
|
||||
"precompile_header": {
|
||||
"label": "precompiled header support",
|
||||
"type": "compile",
|
||||
@ -624,7 +639,7 @@
|
||||
"shared": {
|
||||
"label": "Building shared libraries",
|
||||
"autoDetect": "!config.uikit",
|
||||
"condition": "!config.integrity && !config.wasm",
|
||||
"condition": "!config.integrity && !config.wasm && !config.rtems",
|
||||
"output": [
|
||||
"shared",
|
||||
"publicFeature",
|
||||
@ -677,7 +692,7 @@
|
||||
"autoDetect": "false",
|
||||
"enable" : "input.linker == 'gold' || features.use_gold_linker_alias" ,
|
||||
"disable" : "input.linker == 'bfd' || input.linker == 'lld'",
|
||||
"condition": "!config.win32 && !config.integrity && !config.wasm && tests.use_gold_linker",
|
||||
"condition": "!config.win32 && !config.integrity && !config.wasm && !config.rtems && tests.use_gold_linker",
|
||||
"output": [ "privateConfig", "useGoldLinker" ]
|
||||
},
|
||||
"use_lld_linker": {
|
||||
@ -810,7 +825,7 @@
|
||||
},
|
||||
"largefile": {
|
||||
"label": "Large file support",
|
||||
"condition": "!config.android && !config.integrity && !config.winrt",
|
||||
"condition": "!config.android && !config.integrity && !config.winrt && !config.rtems",
|
||||
"output": [
|
||||
"privateConfig",
|
||||
{ "type": "define", "name": "QT_LARGEFILE_SUPPORT", "value": 64 }
|
||||
@ -907,10 +922,16 @@
|
||||
"output": [ "publicFeature", "publicQtConfig" ]
|
||||
},
|
||||
"c++1z": {
|
||||
"label": "C++1z",
|
||||
"label": "C++17",
|
||||
"condition": "features.c++14 && tests.c++1z",
|
||||
"output": [ "publicFeature", "publicQtConfig" ]
|
||||
},
|
||||
"c++2a": {
|
||||
"label": "C++2a",
|
||||
"autoDetect": false,
|
||||
"condition": "features.c++1z && tests.c++2a",
|
||||
"output": [ "publicFeature", "publicQtConfig" ]
|
||||
},
|
||||
"c89": {
|
||||
"label": "C89"
|
||||
},
|
||||
@ -1281,6 +1302,12 @@
|
||||
"condition": "libs.libudev",
|
||||
"output": [ "privateFeature" ]
|
||||
},
|
||||
"qt_libinfix_plugins": {
|
||||
"label": "Use QT_LIBINFIX for Plugins",
|
||||
"autoDetect": false,
|
||||
"enable": "input.qt_libinfix != '' && input.qt_libinfix_plugins == 'yes'",
|
||||
"output": [ "privateConfig" ]
|
||||
},
|
||||
"compile_examples": {
|
||||
"label": "Compile examples",
|
||||
"autoDetect": "!config.wasm",
|
||||
@ -1408,7 +1435,7 @@
|
||||
{
|
||||
"message": "Using C++ standard",
|
||||
"type": "firstAvailableFeature",
|
||||
"args": "c++1z c++14 c++11"
|
||||
"args": "c++2a c++1z c++14 c++11"
|
||||
},
|
||||
{
|
||||
"type": "feature",
|
||||
|
@ -14,21 +14,26 @@ defineTest(qtConfCommandline_qmakeArgs) {
|
||||
}
|
||||
|
||||
defineTest(qtConfCommandline_cxxstd) {
|
||||
msvc: \
|
||||
qtConfAddError("Command line option -c++std is not supported with MSVC compilers.")
|
||||
|
||||
arg = $${1}
|
||||
val = $${2}
|
||||
isEmpty(val): val = $$qtConfGetNextCommandlineArg()
|
||||
!contains(val, "^-.*"):!isEmpty(val) {
|
||||
contains(val, "(c\+\+)?11") {
|
||||
qtConfCommandlineSetInput("c++14", "no")
|
||||
qtConfCommandlineSetInput("c++1z", "no")
|
||||
qtConfCommandlineSetInput("c++2a", "no")
|
||||
} else: contains(val, "(c\+\+)?(14|1y)") {
|
||||
qtConfCommandlineSetInput("c++14", "yes")
|
||||
qtConfCommandlineSetInput("c++1z", "no")
|
||||
} else: contains(val, "(c\+\+)?(1z)") {
|
||||
qtConfCommandlineSetInput("c++2a", "no")
|
||||
} else: contains(val, "(c\+\+)?(17|1z)") {
|
||||
qtConfCommandlineSetInput("c++14", "yes")
|
||||
qtConfCommandlineSetInput("c++1z", "yes")
|
||||
qtConfCommandlineSetInput("c++2a", "no")
|
||||
} else: contains(val, "(c\+\+)?(2a)") {
|
||||
qtConfCommandlineSetInput("c++14", "yes")
|
||||
qtConfCommandlineSetInput("c++1z", "yes")
|
||||
qtConfCommandlineSetInput("c++2a", "yes")
|
||||
} else {
|
||||
qtConfAddError("Invalid argument $$val to command line parameter $$arg")
|
||||
}
|
||||
|
82
dist/changes-5.12.3
vendored
Normal file
@ -0,0 +1,82 @@
|
||||
Qt 5.12.3 is a bug-fix release. It maintains both forward and backward
|
||||
compatibility (source and binary) with Qt 5.12.0 through 5.12.2.
|
||||
|
||||
For more details, refer to the online documentation included in this
|
||||
distribution. The documentation is also available online:
|
||||
|
||||
https://doc.qt.io/qt-5/index.html
|
||||
|
||||
The Qt version 5.12 series is binary compatible with the 5.11.x series.
|
||||
Applications compiled for 5.11 will continue to run with 5.12.
|
||||
|
||||
Some of the changes listed in this file include issue tracking numbers
|
||||
corresponding to tasks in the Qt Bug Tracker:
|
||||
|
||||
https://bugreports.qt.io/
|
||||
|
||||
Each of these identifiers can be entered in the bug tracker to obtain more
|
||||
information about a particular change.
|
||||
|
||||
****************************************************************************
|
||||
* Third-Party Code *
|
||||
****************************************************************************
|
||||
|
||||
- Changed classification of the wintab license from Public Domain to
|
||||
Custom.
|
||||
|
||||
****************************************************************************
|
||||
* QtCore *
|
||||
****************************************************************************
|
||||
|
||||
- Event system:
|
||||
* [QTBUG-72438] Fixed a possible race condition on Windows that would
|
||||
cause an interrupted event loop to be stuck until more events were
|
||||
posted.
|
||||
|
||||
- Logging system:
|
||||
* [QTBUG-74359] Fixed the compilation of qCDebug("", ...) when debug
|
||||
output was disabled.
|
||||
|
||||
- QCollator:
|
||||
* [QTBUG-74209] Fixed a bug that caused QCompare to incorrect return a
|
||||
sorting order on Windows if the Win32 API failed.
|
||||
|
||||
- QDateTime / QTimeZone:
|
||||
* [QTBUG-74614] Fixed handling of timezones that contain no DST
|
||||
transitions.
|
||||
|
||||
- QProcess:
|
||||
* [QTBUG-73778] Fixed a crash when calling closeWriteChannel() on Windows.
|
||||
|
||||
****************************************************************************
|
||||
* QtSql *
|
||||
****************************************************************************
|
||||
|
||||
- When cross-compiling pg_config, mysql_config are not looked up in PATH
|
||||
anymore. Pass -psql_config path/to/pg_config or -mysql_config
|
||||
path/to/mysql_config to explicitly enable PSQL or MySQL in this setup.
|
||||
|
||||
****************************************************************************
|
||||
* Platform Specific Changes *
|
||||
****************************************************************************
|
||||
|
||||
- Android:
|
||||
* Text fields with ImhNoPredictiveText set are no longer working around
|
||||
keyboards that disregard this setting. To enforce the workaround, the
|
||||
environment variable
|
||||
QT_ANDROID_ENABLE_WORKAROUND_TO_DISABLE_PREDICTIVE_TEXT should be set.
|
||||
|
||||
* [QTBUG-74029] Added entries in the AndroidManifest.xml for specific
|
||||
portrait and landscape splash screens. If one is present for the current
|
||||
orientation, it will be preferred over the generic one.
|
||||
|
||||
- Linux:
|
||||
* [QTBUG-74526] Changed the way we use the statx() system call to use a
|
||||
fallback mechanism provided by the GNU C library. This should allow Qt
|
||||
applications that are compiled with glibc >= 2.28 to run even on kernels
|
||||
older than 4.11.
|
||||
|
||||
- Windows:
|
||||
* [QTBUG-74062] Fixed QToolTip pop-ups and QComboBox animation pop-ups
|
||||
being off by a few pixels on Windows 10.
|
||||
|
@ -62,28 +62,37 @@
|
||||
*/
|
||||
|
||||
/*!
|
||||
\externalpage http://www.cmake.org/cmake/help/v2.8.11/cmake.html#command:find_package
|
||||
\externalpage https://cmake.org/cmake/help/latest/command/find_package.html
|
||||
\title CMake find_package Documentation
|
||||
*/
|
||||
|
||||
/*!
|
||||
\externalpage http://www.cmake.org/cmake/help/v2.8.11/cmake.html#prop_tgt:AUTOMOC
|
||||
\externalpage https://cmake.org/cmake/help/latest/manual/cmake-qt.7.html#automoc
|
||||
\title CMake AUTOMOC Documentation
|
||||
*/
|
||||
|
||||
/*!
|
||||
\externalpage https://cmake.org/cmake/help/latest/manual/cmake-qt.7.html#autorcc
|
||||
\title CMake AUTORCC Documentation
|
||||
*/
|
||||
|
||||
/*!
|
||||
\externalpage http://www.cmake.org/cmake/help/v2.8.11/cmake.html#prop_tgt:LOCATION
|
||||
\externalpage https://cmake.org/cmake/help/latest/manual/cmake-qt.7.html#autouic
|
||||
\title CMake AUTOUIC Documentation
|
||||
*/
|
||||
|
||||
/*!
|
||||
\externalpage https://cmake.org/cmake/help/latest/prop_tgt/LOCATION.html
|
||||
\title CMake LOCATION Documentation
|
||||
*/
|
||||
|
||||
/*!
|
||||
\externalpage http://www.cmake.org/cmake/help/v2.8.11/cmake.html#prop_tgt:POSITION_INDEPENDENT_CODE
|
||||
\externalpage https://cmake.org/cmake/help/latest/prop_tgt/POSITION_INDEPENDENT_CODE.html
|
||||
\title CMake POSITION_INDEPENDENT_CODE Documentation
|
||||
*/
|
||||
|
||||
/*!
|
||||
\externalpage http://www.cmake.org/cmake/help/v2.8.11/cmake.html#command:target_link_libraries
|
||||
\externalpage https://cmake.org/cmake/help/latest/command/target_link_libraries.html
|
||||
\title CMake target_link_libraries Documentation
|
||||
*/
|
||||
|
||||
|
52
doc/global/includes/module-use.qdocinc
Normal file
@ -0,0 +1,52 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2019 The Qt Company Ltd.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the documentation of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:FDL$
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU Free Documentation License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Free
|
||||
** Documentation License version 1.3 as published by the Free Software
|
||||
** Foundation and appearing in the file included in the packaging of
|
||||
** this file. Please review the following information to ensure
|
||||
** the GNU Free Documentation License version 1.3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
//! [using qt module]
|
||||
|
||||
\section1 Using the Module
|
||||
|
||||
Using a Qt module requires linking against the module library, either
|
||||
directly or through other dependencies. Several build tools have dedicated
|
||||
support for this, including \l{CMake Documentation}{CMake} and
|
||||
\l{qmake}.
|
||||
|
||||
\section2 Building with CMake
|
||||
|
||||
Use the \c{find_package()} command to locate the needed module components in
|
||||
the \c{Qt5} package:
|
||||
|
||||
//! [using qt module]
|
||||
|
||||
|
||||
//! [building with qmake]
|
||||
|
||||
\section2 Building with qmake
|
||||
|
||||
To configure the module for building with qmake, add the module as a value
|
||||
of the \c QT variable in the project's .pro file:
|
||||
|
||||
//! [building with qmake]
|
@ -18,6 +18,8 @@ HTML.extraimages += template/images/ico_out.png \
|
||||
template/images/bullet_sq.png \
|
||||
template/images/bgrContent.png
|
||||
|
||||
sourcedirs += includes
|
||||
|
||||
#specify which files in the output directory should be packed into the qch file.
|
||||
qhp.extraFiles += style/offline.css \
|
||||
images/ico_out.png \
|
||||
|
@ -9,4 +9,5 @@ defines += onlinedocs
|
||||
#uncomment if navigation bar is not wanted
|
||||
#HTML.nonavigationbar = "true"
|
||||
|
||||
sourcedirs += includes-online
|
||||
sourcedirs += includes-online \
|
||||
includes
|
||||
|
@ -226,7 +226,7 @@ void CborDiagnosticDumper::saveFile(QIODevice *f, const QVariant &contents, cons
|
||||
|
||||
QTextStream out(f);
|
||||
out << convertFromVariant(contents, Double).toDiagnosticNotation(opts)
|
||||
<< endl;
|
||||
<< Qt::endl;
|
||||
}
|
||||
|
||||
CborConverter::CborConverter()
|
||||
|
@ -66,7 +66,7 @@ static void dumpVariant(QTextStream &out, const QVariant &v)
|
||||
case QVariant::String: {
|
||||
const QStringList list = v.toStringList();
|
||||
for (const QString &s : list)
|
||||
out << s << endl;
|
||||
out << s << Qt::endl;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -80,11 +80,11 @@ static void dumpVariant(QTextStream &out, const QVariant &v)
|
||||
}
|
||||
|
||||
case QMetaType::Nullptr:
|
||||
out << "(null)" << endl;
|
||||
out << "(null)" << Qt::endl;
|
||||
break;
|
||||
|
||||
default:
|
||||
out << v.toString() << endl;
|
||||
out << v.toString() << Qt::endl;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -255,11 +255,7 @@ public:
|
||||
protected:
|
||||
|
||||
void resizeEvent(QResizeEvent*) {
|
||||
#if defined(Q_OS_WINCE_WM)
|
||||
touchDevice = true;
|
||||
#else
|
||||
touchDevice = false;
|
||||
#endif
|
||||
if (touchDevice) {
|
||||
if (width() < height()) {
|
||||
trackPad = QRect(0, height() / 2, width(), height() / 2);
|
||||
|
@ -13,7 +13,7 @@ FORMS = bearermonitor_240_320.ui \
|
||||
bearermonitor_640_480.ui \
|
||||
sessionwidget.ui
|
||||
|
||||
win32:LIBS += -lws2_32
|
||||
win32: QMAKE_USE += ws2_32
|
||||
|
||||
CONFIG += console
|
||||
|
||||
|
@ -123,11 +123,11 @@ void RateController::transfer()
|
||||
qint64 writeChunk = qMax<qint64>(1, bytesToWrite / pendingSockets.size());
|
||||
qint64 readChunk = qMax<qint64>(1, bytesToRead / pendingSockets.size());
|
||||
|
||||
QSetIterator<PeerWireClient *> it(pendingSockets);
|
||||
while (it.hasNext() && (bytesToWrite > 0 || bytesToRead > 0)) {
|
||||
PeerWireClient *socket = it.next();
|
||||
for (auto it = pendingSockets.begin(), end = pendingSockets.end(); it != end && (bytesToWrite > 0 || bytesToRead > 0); /*erasing*/) {
|
||||
auto current = it++;
|
||||
PeerWireClient *socket = *current;
|
||||
if (socket->state() != QAbstractSocket::ConnectedState) {
|
||||
pendingSockets.remove(socket);
|
||||
pendingSockets.erase(current);
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -156,7 +156,7 @@ void RateController::transfer()
|
||||
if (dataTransferred && socket->canTransferMore())
|
||||
canTransferMore = true;
|
||||
else
|
||||
pendingSockets.remove(socket);
|
||||
pendingSockets.erase(current);
|
||||
}
|
||||
} while (canTransferMore && (bytesToWrite > 0 || bytesToRead > 0) && !pendingSockets.isEmpty());
|
||||
|
||||
|
@ -720,9 +720,9 @@ QList<TorrentPeer *> TorrentClient::weighedFreePeers() const
|
||||
qint64 now = QDateTime::currentSecsSinceEpoch();
|
||||
QList<TorrentPeer *> freePeers;
|
||||
QMap<QString, int> connectionsPerPeer;
|
||||
for (TorrentPeer *peer : d->peers) {
|
||||
for (TorrentPeer *peer : qAsConst(d->peers)) {
|
||||
bool busy = false;
|
||||
for (PeerWireClient *client : d->connections) {
|
||||
for (PeerWireClient *client : qAsConst(d->connections)) {
|
||||
if (client->state() == PeerWireClient::ConnectedState
|
||||
&& client->peerAddress() == peer->address
|
||||
&& client->peerPort() == peer->port) {
|
||||
@ -1084,25 +1084,25 @@ void TorrentClient::scheduleUploads()
|
||||
// seeding, we sort by upload speed. Seeds are left out; there's
|
||||
// no use in unchoking them.
|
||||
QList<PeerWireClient *> allClients = d->connections;
|
||||
QMultiMap<int, PeerWireClient *> transferSpeeds;
|
||||
QVector<QPair<qint64, PeerWireClient *>> transferSpeeds;
|
||||
for (PeerWireClient *client : qAsConst(allClients)) {
|
||||
if (client->state() == QAbstractSocket::ConnectedState
|
||||
&& client->availablePieces().count(true) != d->pieceCount) {
|
||||
if (d->state == Seeding) {
|
||||
transferSpeeds.insert(client->uploadSpeed(), client);
|
||||
transferSpeeds.push_back({client->uploadSpeed(), client});
|
||||
} else {
|
||||
transferSpeeds.insert(client->downloadSpeed(), client);
|
||||
transferSpeeds.push_back({client->downloadSpeed(), client});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::sort(transferSpeeds.begin(), transferSpeeds.end());
|
||||
|
||||
// Unchoke the top 'MaxUploads' downloaders (peers that we are
|
||||
// uploading to) and choke all others.
|
||||
int maxUploaders = MaxUploads;
|
||||
QMapIterator<int, PeerWireClient *> it(transferSpeeds);
|
||||
it.toBack();
|
||||
while (it.hasPrevious()) {
|
||||
PeerWireClient *client = it.previous().value();
|
||||
for (auto rit = transferSpeeds.crbegin(), rend = transferSpeeds.crend(); rit != rend; ++rit) {
|
||||
PeerWireClient *client = rit->second;
|
||||
bool interested = (client->peerWireState() & PeerWireClient::PeerIsInterested);
|
||||
|
||||
if (maxUploaders) {
|
||||
@ -1484,30 +1484,26 @@ void TorrentClient::addToPeerList(const QList<TorrentPeer> &peerList)
|
||||
// of the peers that have no (or low) activity.
|
||||
int maxPeers = ConnectionManager::instance()->maxConnections() * 3;
|
||||
if (d->peers.size() > maxPeers) {
|
||||
auto tooMany = d->peers.size() - maxPeers;
|
||||
|
||||
// Find what peers are currently connected & active
|
||||
QSet<TorrentPeer *> activePeers;
|
||||
for (TorrentPeer *peer : qAsConst(d->peers)) {
|
||||
const auto firstNInactivePeers = [&tooMany, this] (TorrentPeer *peer) {
|
||||
if (!tooMany)
|
||||
return false;
|
||||
for (const PeerWireClient *client : qAsConst(d->connections)) {
|
||||
if (client->peer() == peer && (client->downloadSpeed() + client->uploadSpeed()) > 1024)
|
||||
activePeers << peer;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
--tooMany;
|
||||
return true;
|
||||
};
|
||||
// Remove inactive peers from the peer list until we're below
|
||||
// the max connections count.
|
||||
QList<int> toRemove;
|
||||
for (int i = 0; i < d->peers.size() && (d->peers.size() - toRemove.size()) > maxPeers; ++i) {
|
||||
if (!activePeers.contains(d->peers.at(i)))
|
||||
toRemove << i;
|
||||
}
|
||||
QListIterator<int> toRemoveIterator(toRemove);
|
||||
toRemoveIterator.toBack();
|
||||
while (toRemoveIterator.hasPrevious())
|
||||
d->peers.removeAt(toRemoveIterator.previous());
|
||||
|
||||
d->peers.erase(std::remove_if(d->peers.begin(), d->peers.end(),
|
||||
firstNInactivePeers),
|
||||
d->peers.end());
|
||||
// If we still have too many peers, remove the oldest ones.
|
||||
while (d->peers.size() > maxPeers)
|
||||
d->peers.takeFirst();
|
||||
d->peers.erase(d->peers.begin(), d->peers.begin() + tooMany);
|
||||
}
|
||||
|
||||
if (d->state != Paused && d->state != Stopping && d->state != Idle) {
|
||||
|
@ -384,7 +384,7 @@ void Widget::renderWindowReady()
|
||||
m_output->append(tr("Qt OpenGL library handle: %1")
|
||||
.arg(QString::number(qintptr(QOpenGLContext::openGLModuleHandle()), 16)));
|
||||
|
||||
QList<QByteArray> extensionList = context->extensions().toList();
|
||||
QList<QByteArray> extensionList = context->extensions().values();
|
||||
std::sort(extensionList.begin(), extensionList.end());
|
||||
m_extensions->append(tr("Found %1 extensions:").arg(extensionList.count()));
|
||||
for (const QByteArray &ext : qAsConst(extensionList))
|
||||
|
@ -69,11 +69,11 @@ int main(int argc, char *argv[])
|
||||
QSurfaceFormat fmt;
|
||||
fmt.setDepthBufferSize(24);
|
||||
|
||||
// Request OpenGL 3.3 compatibility or OpenGL ES 3.0.
|
||||
// Request OpenGL 3.3 core or OpenGL ES 3.0.
|
||||
if (QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGL) {
|
||||
qDebug("Requesting 3.3 compatibility context");
|
||||
qDebug("Requesting 3.3 core context");
|
||||
fmt.setVersion(3, 3);
|
||||
fmt.setProfile(QSurfaceFormat::CompatibilityProfile);
|
||||
fmt.setProfile(QSurfaceFormat::CoreProfile);
|
||||
} else {
|
||||
qDebug("Requesting 3.0 context");
|
||||
fmt.setVersion(3, 0);
|
||||
|
@ -247,12 +247,8 @@ void GLWidget::createBubbles(int number)
|
||||
//! [13]
|
||||
void GLWidget::animate()
|
||||
{
|
||||
QMutableListIterator<Bubble*> iter(bubbles);
|
||||
|
||||
while (iter.hasNext()) {
|
||||
Bubble *bubble = iter.next();
|
||||
for (Bubble *bubble : qAsConst(bubbles))
|
||||
bubble->move(rect());
|
||||
}
|
||||
update();
|
||||
}
|
||||
//! [13]
|
||||
|
@ -399,12 +399,9 @@ void GLWidget::paintGL()
|
||||
|
||||
painter.end();
|
||||
|
||||
QMutableListIterator<Bubble*> iter(m_bubbles);
|
||||
|
||||
while (iter.hasNext()) {
|
||||
Bubble *bubble = iter.next();
|
||||
for (Bubble *bubble : qAsConst(m_bubbles))
|
||||
bubble->move(rect());
|
||||
}
|
||||
|
||||
if (!(m_frames % 100)) {
|
||||
m_time.start();
|
||||
m_frames = 0;
|
||||
|
@ -126,11 +126,8 @@ WordCount countWords(const QString &file)
|
||||
// at a time.
|
||||
void reduce(WordCount &result, const WordCount &w)
|
||||
{
|
||||
QMapIterator<QString, int> i(w);
|
||||
while (i.hasNext()) {
|
||||
i.next();
|
||||
for (auto i = w.begin(), end = w.end(); i != end; ++i)
|
||||
result[i.key()] += i.value();
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char** argv)
|
||||
|
@ -287,7 +287,6 @@ Dialog::Dialog(QWidget *parent)
|
||||
fileDialogOptionsWidget->addCheckBox(tr("Show directories only"), QFileDialog::ShowDirsOnly);
|
||||
fileDialogOptionsWidget->addCheckBox(tr("Do not resolve symlinks"), QFileDialog::DontResolveSymlinks);
|
||||
fileDialogOptionsWidget->addCheckBox(tr("Do not confirm overwrite"), QFileDialog::DontConfirmOverwrite);
|
||||
fileDialogOptionsWidget->addCheckBox(tr("Do not use sheet"), QFileDialog::DontUseSheet);
|
||||
fileDialogOptionsWidget->addCheckBox(tr("Readonly"), QFileDialog::ReadOnly);
|
||||
fileDialogOptionsWidget->addCheckBox(tr("Hide name filter details"), QFileDialog::HideNameFilterDetails);
|
||||
fileDialogOptionsWidget->addCheckBox(tr("Do not use custom directory icons (Windows)"), QFileDialog::DontUseCustomDirectoryIcons);
|
||||
|
@ -262,12 +262,7 @@
|
||||
provides arrays allowing to map from enumeration value to row/column
|
||||
(by using QVector::indexOf()) and back by using the array index and lists
|
||||
of the matching strings. Qt's containers can be easily populated by
|
||||
using C++ 11 initializer lists. If the compiler does not provide that feature,
|
||||
a pattern like
|
||||
|
||||
\snippet widgets/icons/iconpreviewarea.cpp 43
|
||||
|
||||
can be used.
|
||||
using C++ 11 initializer lists.
|
||||
|
||||
We need two public functions to set the current icon and the
|
||||
icon's size. In addition the class has three private functions: We
|
||||
|
@ -113,15 +113,13 @@ void Arrow::paint(QPainter *painter, const QStyleOptionGraphicsItem *,
|
||||
QLineF centerLine(myStartItem->pos(), myEndItem->pos());
|
||||
QPolygonF endPolygon = myEndItem->polygon();
|
||||
QPointF p1 = endPolygon.first() + myEndItem->pos();
|
||||
QPointF p2;
|
||||
QPointF intersectPoint;
|
||||
QLineF polyLine;
|
||||
for (int i = 1; i < endPolygon.count(); ++i) {
|
||||
p2 = endPolygon.at(i) + myEndItem->pos();
|
||||
polyLine = QLineF(p1, p2);
|
||||
QLineF::IntersectType intersectType =
|
||||
polyLine.intersect(centerLine, &intersectPoint);
|
||||
if (intersectType == QLineF::BoundedIntersection)
|
||||
QPointF p2 = endPolygon.at(i) + myEndItem->pos();
|
||||
QLineF polyLine = QLineF(p1, p2);
|
||||
QLineF::IntersectionType intersectionType =
|
||||
polyLine.intersects(centerLine, &intersectPoint);
|
||||
if (intersectionType == QLineF::BoundedIntersection)
|
||||
break;
|
||||
p1 = p2;
|
||||
}
|
||||
|
@ -56,13 +56,13 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication app(argc, argv);
|
||||
|
||||
QScopedPointer<QStyle> arthurStyle(new ArthurStyle());
|
||||
CompositionWidget compWidget(nullptr);
|
||||
QStyle *arthurStyle = new ArthurStyle();
|
||||
compWidget.setStyle(arthurStyle);
|
||||
compWidget.setStyle(arthurStyle.data());
|
||||
|
||||
const QList<QWidget *> widgets = compWidget.findChildren<QWidget *>();
|
||||
for (QWidget *w : widgets)
|
||||
w->setStyle(arthurStyle);
|
||||
w->setStyle(arthurStyle.data());
|
||||
compWidget.show();
|
||||
|
||||
return app.exec();
|
||||
|
@ -72,7 +72,7 @@ ShadeWidget::ShadeWidget(ShadeType type, QWidget *parent)
|
||||
setPalette(pal);
|
||||
|
||||
} else {
|
||||
setAttribute(Qt::WA_NoBackground);
|
||||
setAttribute(Qt::WA_OpaquePaintEvent);
|
||||
}
|
||||
|
||||
QPolygonF points;
|
||||
|
@ -611,7 +611,8 @@ bool PathStrokeRenderer::event(QEvent *e)
|
||||
case Qt::TouchPointPressed:
|
||||
{
|
||||
// find the point, move it
|
||||
QSet<int> activePoints = QSet<int>::fromList(m_fingerPointMapping.values());
|
||||
const auto mappedPoints = m_fingerPointMapping.values();
|
||||
QSet<int> activePoints = QSet<int>(mappedPoints.begin(), mappedPoints.end());
|
||||
int activePoint = -1;
|
||||
qreal distance = -1;
|
||||
const int pointsCount = m_points.size();
|
||||
|
@ -180,7 +180,8 @@ bool HoverPoints::eventFilter(QObject *object, QEvent *event)
|
||||
case Qt::TouchPointPressed:
|
||||
{
|
||||
// find the point, move it
|
||||
QSet<int> activePoints = QSet<int>::fromList(m_fingerPointMapping.values());
|
||||
const auto mappedPoints = m_fingerPointMapping.values();
|
||||
QSet<int> activePoints = QSet<int>(mappedPoints.begin(), mappedPoints.end());
|
||||
int activePoint = -1;
|
||||
qreal distance = -1;
|
||||
const int pointsCount = m_points.size();
|
||||
|
176
examples/widgets/qnx/foreignwindows/collector.cpp
Normal file
@ -0,0 +1,176 @@
|
||||
/***************************************************************************
|
||||
**
|
||||
** Copyright (C) 2018 QNX Software Systems. All rights reserved.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the plugins of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or (at your option) the GNU General
|
||||
** Public license version 3 or any later version approved by the KDE Free
|
||||
** Qt Foundation. The licenses are as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
|
||||
** https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include <QApplication>
|
||||
#include <QDebug>
|
||||
#include <QHBoxLayout>
|
||||
#include <QWindow>
|
||||
|
||||
#include <algorithm>
|
||||
#include <screen/screen.h>
|
||||
|
||||
#include "collector.h"
|
||||
|
||||
constexpr int MANAGER_EVENT_NAME_SUGGESTION = 9999;
|
||||
|
||||
Collector::Collector(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
{
|
||||
QApplication::instance()->installNativeEventFilter(this);
|
||||
|
||||
QLayout *layout = new QHBoxLayout(this);
|
||||
setLayout(layout);
|
||||
}
|
||||
|
||||
Collector::~Collector()
|
||||
{
|
||||
QApplication::instance()->removeNativeEventFilter(this);
|
||||
}
|
||||
|
||||
bool Collector::nativeEventFilter(const QByteArray &eventType, void *message, long *result)
|
||||
{
|
||||
Q_UNUSED(result);
|
||||
|
||||
if (eventType == QByteArrayLiteral("screen_event_t"))
|
||||
return filterQnxScreenEvent(static_cast<screen_event_t>(message));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Collector::filterQnxScreenEvent(screen_event_t event)
|
||||
{
|
||||
int objectType = SCREEN_OBJECT_TYPE_CONTEXT;
|
||||
screen_get_event_property_iv(event, SCREEN_PROPERTY_OBJECT_TYPE, &objectType);
|
||||
|
||||
if (objectType == SCREEN_OBJECT_TYPE_WINDOW)
|
||||
return filterQnxScreenWindowEvent(event);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Collector::filterQnxScreenWindowEvent(screen_event_t event)
|
||||
{
|
||||
int eventType = SCREEN_EVENT_NONE;
|
||||
screen_get_event_property_iv(event, SCREEN_PROPERTY_TYPE, &eventType);
|
||||
screen_window_t window = nullptr;
|
||||
screen_get_event_property_pv(event,
|
||||
SCREEN_PROPERTY_WINDOW,
|
||||
reinterpret_cast<void **>(&window));
|
||||
|
||||
if (eventType == SCREEN_EVENT_CREATE)
|
||||
return filterQnxScreenWindowCreateEvent(window, event);
|
||||
else if (eventType == SCREEN_EVENT_CLOSE)
|
||||
return filterQnxScreenWindowCloseEvent(window, event);
|
||||
else if (eventType == SCREEN_EVENT_MANAGER)
|
||||
return filterQnxScreenWindowManagerEvent(window, event);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Collector::filterQnxScreenWindowCreateEvent(screen_window_t window, screen_event_t event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
WId winId = reinterpret_cast<WId>(window);
|
||||
|
||||
QByteArray parentGroup(256, 0);
|
||||
screen_get_window_property_cv(window,
|
||||
SCREEN_PROPERTY_PARENT,
|
||||
parentGroup.length(),
|
||||
parentGroup.data());
|
||||
parentGroup.resize(strlen(parentGroup.constData()));
|
||||
|
||||
QByteArray group(256, 0);
|
||||
screen_get_window_property_cv(reinterpret_cast<screen_window_t>(windowHandle()->winId()),
|
||||
SCREEN_PROPERTY_GROUP,
|
||||
group.length(),
|
||||
group.data());
|
||||
group.resize(strlen(group.constData()));
|
||||
|
||||
if (parentGroup != group)
|
||||
return false;
|
||||
|
||||
Collectible collectible;
|
||||
collectible.window = QWindow::fromWinId(winId);
|
||||
collectible.widget = QWidget::createWindowContainer(collectible.window, this);
|
||||
layout()->addWidget(collectible.widget);
|
||||
m_collectibles.append(collectible);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Collector::filterQnxScreenWindowCloseEvent(screen_window_t window, screen_event_t event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
WId winId = reinterpret_cast<WId>(window);
|
||||
auto it = std::find_if(m_collectibles.begin(), m_collectibles.end(),
|
||||
[winId] (const Collectible &collectible) {
|
||||
return collectible.window->winId() == winId;
|
||||
});
|
||||
if (it != m_collectibles.end()) {
|
||||
delete it->widget;
|
||||
// it->window is deleted by it->widget.
|
||||
m_collectibles.erase(it);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Collector::filterQnxScreenWindowManagerEvent(screen_window_t window, screen_event_t event)
|
||||
{
|
||||
int managerEventType = 0;
|
||||
screen_get_event_property_iv(event, SCREEN_PROPERTY_SUBTYPE, &managerEventType);
|
||||
|
||||
if (managerEventType == MANAGER_EVENT_NAME_SUGGESTION)
|
||||
return filterQnxScreenWindowManagerNameEvent(window, event);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Collector::filterQnxScreenWindowManagerNameEvent(screen_window_t window, screen_event_t event)
|
||||
{
|
||||
Q_UNUSED(window);
|
||||
int dataSize = 0;
|
||||
screen_get_event_property_iv(event, SCREEN_PROPERTY_SIZE, &dataSize);
|
||||
if (dataSize > 0) {
|
||||
QByteArray data(dataSize, 0);
|
||||
screen_get_event_property_cv(event, SCREEN_PROPERTY_USER_DATA, data.size(), data.data());
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
75
examples/widgets/qnx/foreignwindows/collector.h
Normal file
@ -0,0 +1,75 @@
|
||||
/***************************************************************************
|
||||
**
|
||||
** Copyright (C) 2018 QNX Software Systems. All rights reserved.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the plugins of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or (at your option) the GNU General
|
||||
** Public license version 3 or any later version approved by the KDE Free
|
||||
** Qt Foundation. The licenses are as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
|
||||
** https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef COLLECTOR_H_
|
||||
#define COLLECTOR_H_
|
||||
|
||||
#include <QAbstractNativeEventFilter>
|
||||
#include <QWidget>
|
||||
#include <QVector>
|
||||
|
||||
#include <screen/screen.h>
|
||||
|
||||
class Collector : public QWidget, public QAbstractNativeEventFilter
|
||||
{
|
||||
public:
|
||||
explicit Collector(QWidget *parent = nullptr);
|
||||
~Collector() override;
|
||||
|
||||
bool nativeEventFilter(const QByteArray &eventType, void *message, long *result) override;
|
||||
|
||||
private:
|
||||
struct Collectible
|
||||
{
|
||||
QWindow *window;
|
||||
QWidget *widget;
|
||||
};
|
||||
QVector<Collectible> m_collectibles;
|
||||
|
||||
bool filterQnxScreenEvent(screen_event_t event);
|
||||
bool filterQnxScreenWindowEvent(screen_event_t event);
|
||||
bool filterQnxScreenWindowCreateEvent(screen_window_t window, screen_event_t event);
|
||||
bool filterQnxScreenWindowCloseEvent(screen_window_t window, screen_event_t event);
|
||||
bool filterQnxScreenWindowManagerEvent(screen_window_t window, screen_event_t event);
|
||||
bool filterQnxScreenWindowManagerNameEvent(screen_window_t window,
|
||||
screen_event_t event);
|
||||
};
|
||||
|
||||
|
||||
#endif /* COLLECTOR_H_ */
|
11
examples/widgets/qnx/foreignwindows/foreignwindows.pro
Normal file
@ -0,0 +1,11 @@
|
||||
TEMPLATE = app
|
||||
|
||||
HEADERS += collector.h
|
||||
SOURCES += main.cpp collector.cpp
|
||||
LIBS += -lscreen
|
||||
|
||||
QT += widgets
|
||||
|
||||
# install
|
||||
target.path = $$[QT_INSTALL_EXAMPLES]/widgets/qnx/foreignwindows
|
||||
INSTALLS += target
|
53
examples/widgets/qnx/foreignwindows/main.cpp
Normal file
@ -0,0 +1,53 @@
|
||||
/***************************************************************************
|
||||
**
|
||||
** Copyright (C) 2018 QNX Software Systems. All rights reserved.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the plugins of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or (at your option) the GNU General
|
||||
** Public license version 3 or any later version approved by the KDE Free
|
||||
** Qt Foundation. The licenses are as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
|
||||
** https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include <QApplication>
|
||||
|
||||
#include "collector.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QApplication app(argc, argv);
|
||||
|
||||
Collector collector;
|
||||
collector.resize(640, 480);
|
||||
collector.show();
|
||||
|
||||
return app.exec();
|
||||
}
|
@ -11,7 +11,7 @@ add_qt_executable(textedit
|
||||
SOURCES
|
||||
main.cpp
|
||||
textedit.cpp textedit.h
|
||||
LIBRARIES
|
||||
PUBLIC_LIBRARIES
|
||||
Qt::Widgets
|
||||
)
|
||||
|
||||
@ -19,6 +19,8 @@ add_qt_executable(textedit
|
||||
add_qt_resource(textedit "textedit" PREFIX "/" FILES
|
||||
example.html
|
||||
images/logo32.png
|
||||
images/mac/checkbox-checked.png
|
||||
images/mac/checkbox.png
|
||||
images/mac/editcopy.png
|
||||
images/mac/editcut.png
|
||||
images/mac/editpaste.png
|
||||
@ -29,6 +31,8 @@ add_qt_resource(textedit "textedit" PREFIX "/" FILES
|
||||
images/mac/fileopen.png
|
||||
images/mac/fileprint.png
|
||||
images/mac/filesave.png
|
||||
images/mac/format-indent-less.png
|
||||
images/mac/format-indent-more.png
|
||||
images/mac/textbold.png
|
||||
images/mac/textcenter.png
|
||||
images/mac/textitalic.png
|
||||
@ -38,6 +42,8 @@ add_qt_resource(textedit "textedit" PREFIX "/" FILES
|
||||
images/mac/textunder.png
|
||||
images/mac/zoomin.png
|
||||
images/mac/zoomout.png
|
||||
images/win/checkbox-checked.png
|
||||
images/win/checkbox.png
|
||||
images/win/editcopy.png
|
||||
images/win/editcut.png
|
||||
images/win/editpaste.png
|
||||
@ -48,6 +54,8 @@ add_qt_resource(textedit "textedit" PREFIX "/" FILES
|
||||
images/win/fileopen.png
|
||||
images/win/fileprint.png
|
||||
images/win/filesave.png
|
||||
images/win/format-indent-less.png
|
||||
images/win/format-indent-more.png
|
||||
images/win/textbold.png
|
||||
images/win/textcenter.png
|
||||
images/win/textitalic.png
|
||||
@ -59,7 +67,7 @@ add_qt_resource(textedit "textedit" PREFIX "/" FILES
|
||||
images/win/zoomout.png)
|
||||
|
||||
|
||||
#### Keys ignored in scope 1:.:textedit.pro:<NONE>:
|
||||
#### Keys ignored in scope 1:.:.:textedit.pro:<TRUE>:
|
||||
# EXAMPLE_FILES = "textedit.qdoc"
|
||||
# TEMPLATE = "app"
|
||||
|
||||
@ -67,9 +75,9 @@ add_qt_resource(textedit "textedit" PREFIX "/" FILES
|
||||
#####################################################################
|
||||
|
||||
extend_target(textedit CONDITION TARGET Qt::PrintSupport
|
||||
LIBRARIES
|
||||
PUBLIC_LIBRARIES
|
||||
Qt::PrintSupport
|
||||
)
|
||||
|
||||
#### Keys ignored in scope 3:.:textedit.pro:build_all AND NOT build_pass:
|
||||
#### Keys ignored in scope 3:.:.:textedit.pro:build_all AND NOT build_pass:
|
||||
# CONFIG = "-build_all" "release"
|
||||
|
102
examples/widgets/richtext/textedit/example.md
Normal file
@ -0,0 +1,102 @@
|
||||
# QTextEdit
|
||||
|
||||
The QTextEdit widget is an advanced editor that supports formatted rich text.
|
||||
It can be used to display HTML and other rich document formats. Internally,
|
||||
QTextEdit uses the QTextDocument class to describe both the high-level
|
||||
structure of each document and the low-level formatting of paragraphs.
|
||||
|
||||
If you are viewing this document in the textedit example, you can edit this
|
||||
document to explore Qt's rich text editing features. We have included some
|
||||
comments in each of the following sections to encourage you to experiment.
|
||||
|
||||
## Font and Paragraph Styles
|
||||
|
||||
QTextEdit supports **bold**, *italic*, & ~~strikethrough~~ font styles, and
|
||||
can display <span style="font-size:10pt; font-weight:600;
|
||||
color:#00007f;">multicolored</span> text. Font families such as <span
|
||||
style="font-family:Times New Roman">Times New Roman</span> and `Courier`
|
||||
can also be used directly. *If you place the cursor in a region of styled text,
|
||||
the controls in the tool bars will change to reflect the current style.*
|
||||
|
||||
Paragraphs can be formatted so that the text is left-aligned, right-aligned,
|
||||
centered, or fully justified.
|
||||
|
||||
*Try changing the alignment of some text and resize the editor to see how the
|
||||
text layout changes.*
|
||||
|
||||
## Lists
|
||||
|
||||
Different kinds of lists can be included in rich text documents. Standard
|
||||
bullet lists can be nested, using different symbols for each level of the list:
|
||||
|
||||
- Disc symbols are typically used for top-level list items.
|
||||
* Circle symbols can be used to distinguish between items in lower-level
|
||||
lists.
|
||||
+ Square symbols provide a reasonable alternative to discs and circles.
|
||||
|
||||
Ordered lists can be created that can be used for tables of contents. Different
|
||||
characters can be used to enumerate items, and we can use both Roman and Arabic
|
||||
numerals in the same list structure:
|
||||
|
||||
1. Introduction
|
||||
2. Qt Tools
|
||||
1) Qt Assistant
|
||||
2) Qt Designer
|
||||
1. Form Editor
|
||||
2. Component Architecture
|
||||
3) Qt Linguist
|
||||
|
||||
The list will automatically be renumbered if you add or remove items. *Try
|
||||
adding new sections to the above list or removing existing item to see the
|
||||
numbers change.*
|
||||
|
||||
Task lists can be used to track progress on projects:
|
||||
|
||||
- [ ] This is not yet done
|
||||
- This is just a bullet point
|
||||
- [x] This is done
|
||||
|
||||
## Images
|
||||
|
||||
Inline images are treated like ordinary ranges of characters in the text
|
||||
editor, so they flow with the surrounding text. Images can also be selected in
|
||||
the same way as text, making it easy to cut, copy, and paste them.
|
||||
|
||||
![logo](images/logo32.png "logo") *Try to select this image by clicking and
|
||||
dragging over it with the mouse, or use the text cursor to select it by holding
|
||||
down Shift and using the arrow keys. You can then cut or copy it, and paste it
|
||||
into different parts of this document.*
|
||||
|
||||
## Tables
|
||||
|
||||
QTextEdit can arrange and format tables, supporting features such as row and
|
||||
column spans, text formatting within cells, and size constraints for columns.
|
||||
|
||||
| | Development Tools | Programming Techniques | Graphical User Interfaces |
|
||||
| ------------: | ----------------- | ---------------------- | ------------------------- |
|
||||
| 9:00 - 11:00 | Introduction to Qt |||
|
||||
| 11:00 - 13:00 | Using qmake | Object-oriented Programming | Layouts in Qt |
|
||||
| 13:00 - 15:00 | Qt Designer Tutorial | Extreme Programming | Writing Custom Styles |
|
||||
| 15:00 - 17:00 | Qt Linguist and Internationalization | | |
|
||||
|
||||
*Try adding text to the cells in the table and experiment with the alignment of
|
||||
the paragraphs.*
|
||||
|
||||
## Hyperlinks
|
||||
|
||||
QTextEdit is designed to support hyperlinks between documents, and this feature
|
||||
is used extensively in
|
||||
[Qt Assistant](http://doc.qt.io/qt-5/qtassistant-index.html). Hyperlinks are
|
||||
automatically created when an HTML file is imported into an editor. Since the
|
||||
rich text framework supports hyperlinks natively, they can also be created
|
||||
programatically.
|
||||
|
||||
## Undo and Redo
|
||||
|
||||
Full support for undo and redo operations is built into QTextEdit and the
|
||||
underlying rich text framework. Operations on a document can be packaged
|
||||
together to make editing a more comfortable experience for the user.
|
||||
|
||||
*Try making changes to this document and press `Ctrl+Z` to undo them. You can
|
||||
always recover the original contents of the document.*
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
BIN
examples/widgets/richtext/textedit/images/mac/checkbox.png
Normal file
After Width: | Height: | Size: 779 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 993 B |
After Width: | Height: | Size: 1.1 KiB |
BIN
examples/widgets/richtext/textedit/images/win/checkbox.png
Normal file
After Width: | Height: | Size: 779 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 993 B |
@ -71,6 +71,7 @@
|
||||
#include <QCloseEvent>
|
||||
#include <QMessageBox>
|
||||
#include <QMimeData>
|
||||
#include <QMimeDatabase>
|
||||
#if defined(QT_PRINTSUPPORT_LIB)
|
||||
#include <QtPrintSupport/qtprintsupportglobal.h>
|
||||
#if QT_CONFIG(printer)
|
||||
@ -316,6 +317,14 @@ void TextEdit::setupTextActions()
|
||||
actionAlignJustify->setShortcut(Qt::CTRL + Qt::Key_J);
|
||||
actionAlignJustify->setCheckable(true);
|
||||
actionAlignJustify->setPriority(QAction::LowPriority);
|
||||
const QIcon indentMoreIcon = QIcon::fromTheme("format-indent-more", QIcon(rsrcPath + "/format-indent-more.png"));
|
||||
actionIndentMore = menu->addAction(indentMoreIcon, tr("&Indent"), this, &TextEdit::indent);
|
||||
actionIndentMore->setShortcut(Qt::CTRL + Qt::Key_BracketRight);
|
||||
actionIndentMore->setPriority(QAction::LowPriority);
|
||||
const QIcon indentLessIcon = QIcon::fromTheme("format-indent-less", QIcon(rsrcPath + "/format-indent-less.png"));
|
||||
actionIndentLess = menu->addAction(indentLessIcon, tr("&Unindent"), this, &TextEdit::unindent);
|
||||
actionIndentLess->setShortcut(Qt::CTRL + Qt::Key_BracketLeft);
|
||||
actionIndentLess->setPriority(QAction::LowPriority);
|
||||
|
||||
// Make sure the alignLeft is always left of the alignRight
|
||||
QActionGroup *alignGroup = new QActionGroup(this);
|
||||
@ -334,6 +343,10 @@ void TextEdit::setupTextActions()
|
||||
|
||||
tb->addActions(alignGroup->actions());
|
||||
menu->addActions(alignGroup->actions());
|
||||
tb->addAction(actionIndentMore);
|
||||
tb->addAction(actionIndentLess);
|
||||
menu->addAction(actionIndentMore);
|
||||
menu->addAction(actionIndentLess);
|
||||
|
||||
menu->addSeparator();
|
||||
|
||||
@ -342,6 +355,15 @@ void TextEdit::setupTextActions()
|
||||
actionTextColor = menu->addAction(pix, tr("&Color..."), this, &TextEdit::textColor);
|
||||
tb->addAction(actionTextColor);
|
||||
|
||||
menu->addSeparator();
|
||||
|
||||
const QIcon checkboxIcon = QIcon::fromTheme("status-checkbox-checked", QIcon(rsrcPath + "/checkbox-checked.png"));
|
||||
actionToggleCheckState = menu->addAction(checkboxIcon, tr("Chec&ked"), this, &TextEdit::setChecked);
|
||||
actionToggleCheckState->setShortcut(Qt::CTRL + Qt::Key_K);
|
||||
actionToggleCheckState->setCheckable(true);
|
||||
actionToggleCheckState->setPriority(QAction::LowPriority);
|
||||
tb->addAction(actionToggleCheckState);
|
||||
|
||||
tb = addToolBar(tr("Format Actions"));
|
||||
tb->setAllowedAreas(Qt::TopToolBarArea | Qt::BottomToolBarArea);
|
||||
addToolBarBreak(Qt::TopToolBarArea);
|
||||
@ -353,6 +375,8 @@ void TextEdit::setupTextActions()
|
||||
comboStyle->addItem("Bullet List (Disc)");
|
||||
comboStyle->addItem("Bullet List (Circle)");
|
||||
comboStyle->addItem("Bullet List (Square)");
|
||||
comboStyle->addItem("Task List (Unchecked)");
|
||||
comboStyle->addItem("Task List (Checked)");
|
||||
comboStyle->addItem("Ordered List (Decimal)");
|
||||
comboStyle->addItem("Ordered List (Alpha lower)");
|
||||
comboStyle->addItem("Ordered List (Alpha upper)");
|
||||
@ -395,11 +419,18 @@ bool TextEdit::load(const QString &f)
|
||||
QByteArray data = file.readAll();
|
||||
QTextCodec *codec = Qt::codecForHtml(data);
|
||||
QString str = codec->toUnicode(data);
|
||||
QUrl baseUrl = (f.front() == QLatin1Char(':') ? QUrl(f) : QUrl::fromLocalFile(f)).adjusted(QUrl::RemoveFilename);
|
||||
textEdit->document()->setBaseUrl(baseUrl);
|
||||
if (Qt::mightBeRichText(str)) {
|
||||
textEdit->setHtml(str);
|
||||
} else {
|
||||
str = QString::fromLocal8Bit(data);
|
||||
textEdit->setPlainText(str);
|
||||
#if QT_CONFIG(textmarkdownreader)
|
||||
QMimeDatabase db;
|
||||
if (db.mimeTypeForFileNameAndData(f, data).name() == QLatin1String("text/markdown"))
|
||||
textEdit->setMarkdown(str);
|
||||
else
|
||||
#endif
|
||||
textEdit->setPlainText(QString::fromLocal8Bit(data));
|
||||
}
|
||||
|
||||
setCurrentFileName(f);
|
||||
@ -451,7 +482,15 @@ void TextEdit::fileOpen()
|
||||
QFileDialog fileDialog(this, tr("Open File..."));
|
||||
fileDialog.setAcceptMode(QFileDialog::AcceptOpen);
|
||||
fileDialog.setFileMode(QFileDialog::ExistingFile);
|
||||
fileDialog.setMimeTypeFilters(QStringList() << "text/html" << "text/plain");
|
||||
fileDialog.setMimeTypeFilters(QStringList()
|
||||
#if QT_CONFIG(texthtmlparser)
|
||||
<< "text/html"
|
||||
#endif
|
||||
#if QT_CONFIG(textmarkdownreader)
|
||||
|
||||
<< "text/markdown"
|
||||
#endif
|
||||
<< "text/plain");
|
||||
if (fileDialog.exec() != QDialog::Accepted)
|
||||
return;
|
||||
const QString fn = fileDialog.selectedFiles().first();
|
||||
@ -485,9 +524,18 @@ bool TextEdit::fileSaveAs()
|
||||
QFileDialog fileDialog(this, tr("Save as..."));
|
||||
fileDialog.setAcceptMode(QFileDialog::AcceptSave);
|
||||
QStringList mimeTypes;
|
||||
mimeTypes << "application/vnd.oasis.opendocument.text" << "text/html" << "text/plain";
|
||||
mimeTypes << "text/plain"
|
||||
#if QT_CONFIG(textodfwriter)
|
||||
<< "application/vnd.oasis.opendocument.text"
|
||||
#endif
|
||||
#if QT_CONFIG(textmarkdownwriter)
|
||||
<< "text/markdown"
|
||||
#endif
|
||||
<< "text/html";
|
||||
fileDialog.setMimeTypeFilters(mimeTypes);
|
||||
#if QT_CONFIG(textodfwriter)
|
||||
fileDialog.setDefaultSuffix("odt");
|
||||
#endif
|
||||
if (fileDialog.exec() != QDialog::Accepted)
|
||||
return false;
|
||||
const QString fn = fileDialog.selectedFiles().first();
|
||||
@ -592,6 +640,7 @@ void TextEdit::textStyle(int styleIndex)
|
||||
{
|
||||
QTextCursor cursor = textEdit->textCursor();
|
||||
QTextListFormat::Style style = QTextListFormat::ListStyleUndefined;
|
||||
QTextBlockFormat::MarkerType marker = QTextBlockFormat::NoMarker;
|
||||
|
||||
switch (styleIndex) {
|
||||
case 1:
|
||||
@ -604,18 +653,32 @@ void TextEdit::textStyle(int styleIndex)
|
||||
style = QTextListFormat::ListSquare;
|
||||
break;
|
||||
case 4:
|
||||
style = QTextListFormat::ListDecimal;
|
||||
if (cursor.currentList())
|
||||
style = cursor.currentList()->format().style();
|
||||
else
|
||||
style = QTextListFormat::ListDisc;
|
||||
marker = QTextBlockFormat::Unchecked;
|
||||
break;
|
||||
case 5:
|
||||
style = QTextListFormat::ListLowerAlpha;
|
||||
if (cursor.currentList())
|
||||
style = cursor.currentList()->format().style();
|
||||
else
|
||||
style = QTextListFormat::ListDisc;
|
||||
marker = QTextBlockFormat::Checked;
|
||||
break;
|
||||
case 6:
|
||||
style = QTextListFormat::ListUpperAlpha;
|
||||
style = QTextListFormat::ListDecimal;
|
||||
break;
|
||||
case 7:
|
||||
style = QTextListFormat::ListLowerRoman;
|
||||
style = QTextListFormat::ListLowerAlpha;
|
||||
break;
|
||||
case 8:
|
||||
style = QTextListFormat::ListUpperAlpha;
|
||||
break;
|
||||
case 9:
|
||||
style = QTextListFormat::ListLowerRoman;
|
||||
break;
|
||||
case 10:
|
||||
style = QTextListFormat::ListUpperRoman;
|
||||
break;
|
||||
default:
|
||||
@ -628,7 +691,7 @@ void TextEdit::textStyle(int styleIndex)
|
||||
|
||||
if (style == QTextListFormat::ListStyleUndefined) {
|
||||
blockFmt.setObjectIndex(-1);
|
||||
int headingLevel = styleIndex >= 9 ? styleIndex - 9 + 1 : 0; // H1 to H6, or Standard
|
||||
int headingLevel = styleIndex >= 11 ? styleIndex - 11 + 1 : 0; // H1 to H6, or Standard
|
||||
blockFmt.setHeadingLevel(headingLevel);
|
||||
cursor.setBlockFormat(blockFmt);
|
||||
|
||||
@ -640,6 +703,8 @@ void TextEdit::textStyle(int styleIndex)
|
||||
cursor.mergeCharFormat(fmt);
|
||||
textEdit->mergeCurrentCharFormat(fmt);
|
||||
} else {
|
||||
blockFmt.setMarker(marker);
|
||||
cursor.setBlockFormat(blockFmt);
|
||||
QTextListFormat listFmt;
|
||||
if (cursor.currentList()) {
|
||||
listFmt = cursor.currentList()->format();
|
||||
@ -678,6 +743,45 @@ void TextEdit::textAlign(QAction *a)
|
||||
textEdit->setAlignment(Qt::AlignJustify);
|
||||
}
|
||||
|
||||
void TextEdit::setChecked(bool checked)
|
||||
{
|
||||
textStyle(checked ? 5 : 4);
|
||||
}
|
||||
|
||||
void TextEdit::indent()
|
||||
{
|
||||
modifyIndentation(1);
|
||||
}
|
||||
|
||||
void TextEdit::unindent()
|
||||
{
|
||||
modifyIndentation(-1);
|
||||
}
|
||||
|
||||
void TextEdit::modifyIndentation(int amount)
|
||||
{
|
||||
QTextCursor cursor = textEdit->textCursor();
|
||||
cursor.beginEditBlock();
|
||||
if (cursor.currentList()) {
|
||||
QTextListFormat listFmt = cursor.currentList()->format();
|
||||
// See whether the line above is the list we want to move this item into,
|
||||
// or whether we need a new list.
|
||||
QTextCursor above(cursor);
|
||||
above.movePosition(QTextCursor::Up);
|
||||
if (above.currentList() && listFmt.indent() + amount == above.currentList()->format().indent()) {
|
||||
above.currentList()->add(cursor.block());
|
||||
} else {
|
||||
listFmt.setIndent(listFmt.indent() + amount);
|
||||
cursor.createList(listFmt);
|
||||
}
|
||||
} else {
|
||||
QTextBlockFormat blockFmt = cursor.blockFormat();
|
||||
blockFmt.setIndent(blockFmt.indent() + amount);
|
||||
cursor.setBlockFormat(blockFmt);
|
||||
}
|
||||
cursor.endEditBlock();
|
||||
}
|
||||
|
||||
void TextEdit::currentCharFormatChanged(const QTextCharFormat &format)
|
||||
{
|
||||
fontChanged(format.font());
|
||||
@ -700,27 +804,40 @@ void TextEdit::cursorPositionChanged()
|
||||
comboStyle->setCurrentIndex(3);
|
||||
break;
|
||||
case QTextListFormat::ListDecimal:
|
||||
comboStyle->setCurrentIndex(4);
|
||||
break;
|
||||
case QTextListFormat::ListLowerAlpha:
|
||||
comboStyle->setCurrentIndex(5);
|
||||
break;
|
||||
case QTextListFormat::ListUpperAlpha:
|
||||
comboStyle->setCurrentIndex(6);
|
||||
break;
|
||||
case QTextListFormat::ListLowerRoman:
|
||||
case QTextListFormat::ListLowerAlpha:
|
||||
comboStyle->setCurrentIndex(7);
|
||||
break;
|
||||
case QTextListFormat::ListUpperRoman:
|
||||
case QTextListFormat::ListUpperAlpha:
|
||||
comboStyle->setCurrentIndex(8);
|
||||
break;
|
||||
case QTextListFormat::ListLowerRoman:
|
||||
comboStyle->setCurrentIndex(9);
|
||||
break;
|
||||
case QTextListFormat::ListUpperRoman:
|
||||
comboStyle->setCurrentIndex(10);
|
||||
break;
|
||||
default:
|
||||
comboStyle->setCurrentIndex(-1);
|
||||
break;
|
||||
}
|
||||
switch (textEdit->textCursor().block().blockFormat().marker()) {
|
||||
case QTextBlockFormat::NoMarker:
|
||||
actionToggleCheckState->setChecked(false);
|
||||
break;
|
||||
case QTextBlockFormat::Unchecked:
|
||||
comboStyle->setCurrentIndex(4);
|
||||
actionToggleCheckState->setChecked(false);
|
||||
break;
|
||||
case QTextBlockFormat::Checked:
|
||||
comboStyle->setCurrentIndex(5);
|
||||
actionToggleCheckState->setChecked(true);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
int headingLevel = textEdit->textCursor().blockFormat().headingLevel();
|
||||
comboStyle->setCurrentIndex(headingLevel ? headingLevel + 8 : 0);
|
||||
comboStyle->setCurrentIndex(headingLevel ? headingLevel + 10 : 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -96,6 +96,9 @@ private slots:
|
||||
void textStyle(int styleIndex);
|
||||
void textColor();
|
||||
void textAlign(QAction *a);
|
||||
void setChecked(bool checked);
|
||||
void indent();
|
||||
void unindent();
|
||||
|
||||
void currentCharFormatChanged(const QTextCharFormat &format);
|
||||
void cursorPositionChanged();
|
||||
@ -110,6 +113,7 @@ private:
|
||||
void setupTextActions();
|
||||
bool maybeSave();
|
||||
void setCurrentFileName(const QString &fileName);
|
||||
void modifyIndentation(int amount);
|
||||
|
||||
void mergeFormatOnWordOrSelection(const QTextCharFormat &format);
|
||||
void fontChanged(const QFont &f);
|
||||
@ -125,6 +129,9 @@ private:
|
||||
QAction *actionAlignCenter;
|
||||
QAction *actionAlignRight;
|
||||
QAction *actionAlignJustify;
|
||||
QAction *actionIndentLess;
|
||||
QAction *actionIndentMore;
|
||||
QAction *actionToggleCheckState;
|
||||
QAction *actionUndo;
|
||||
QAction *actionRedo;
|
||||
#ifndef QT_NO_CLIPBOARD
|
||||
|
@ -1,6 +1,8 @@
|
||||
<!DOCTYPE RCC><RCC version="1.0">
|
||||
<qresource prefix="/">
|
||||
<file>images/logo32.png</file>
|
||||
<file>images/mac/checkbox.png</file>
|
||||
<file>images/mac/checkbox-checked.png</file>
|
||||
<file>images/mac/editcopy.png</file>
|
||||
<file>images/mac/editcut.png</file>
|
||||
<file>images/mac/editpaste.png</file>
|
||||
@ -11,6 +13,8 @@
|
||||
<file>images/mac/fileopen.png</file>
|
||||
<file>images/mac/fileprint.png</file>
|
||||
<file>images/mac/filesave.png</file>
|
||||
<file>images/mac/format-indent-less.png</file>
|
||||
<file>images/mac/format-indent-more.png</file>
|
||||
<file>images/mac/textbold.png</file>
|
||||
<file>images/mac/textcenter.png</file>
|
||||
<file>images/mac/textitalic.png</file>
|
||||
@ -20,6 +24,8 @@
|
||||
<file>images/mac/textunder.png</file>
|
||||
<file>images/mac/zoomin.png</file>
|
||||
<file>images/mac/zoomout.png</file>
|
||||
<file>images/win/checkbox.png</file>
|
||||
<file>images/win/checkbox-checked.png</file>
|
||||
<file>images/win/editcopy.png</file>
|
||||
<file>images/win/editcut.png</file>
|
||||
<file>images/win/editpaste.png</file>
|
||||
@ -30,6 +36,8 @@
|
||||
<file>images/win/fileopen.png</file>
|
||||
<file>images/win/fileprint.png</file>
|
||||
<file>images/win/filesave.png</file>
|
||||
<file>images/win/format-indent-less.png</file>
|
||||
<file>images/win/format-indent-more.png</file>
|
||||
<file>images/win/textbold.png</file>
|
||||
<file>images/win/textcenter.png</file>
|
||||
<file>images/win/textitalic.png</file>
|
||||
|
@ -163,11 +163,8 @@ QStringList LanguageChooser::findQmFiles()
|
||||
QDir dir(":/translations");
|
||||
QStringList fileNames = dir.entryList(QStringList("*.qm"), QDir::Files,
|
||||
QDir::Name);
|
||||
QMutableStringListIterator i(fileNames);
|
||||
while (i.hasNext()) {
|
||||
i.next();
|
||||
i.setValue(dir.filePath(i.value()));
|
||||
}
|
||||
for (QString &fileName : fileNames)
|
||||
fileName = dir.filePath(fileName);
|
||||
return fileNames;
|
||||
}
|
||||
|
||||
|
@ -68,7 +68,7 @@ QT_END_NAMESPACE
|
||||
class BrushInterface
|
||||
{
|
||||
public:
|
||||
virtual ~BrushInterface() {}
|
||||
virtual ~BrushInterface() = default;
|
||||
|
||||
virtual QStringList brushes() const = 0;
|
||||
virtual QRect mousePress(const QString &brush, QPainter &painter,
|
||||
@ -84,7 +84,7 @@ public:
|
||||
class ShapeInterface
|
||||
{
|
||||
public:
|
||||
virtual ~ShapeInterface() {}
|
||||
virtual ~ShapeInterface() = default;
|
||||
|
||||
virtual QStringList shapes() const = 0;
|
||||
virtual QPainterPath generateShape(const QString &shape,
|
||||
@ -96,7 +96,7 @@ public:
|
||||
class FilterInterface
|
||||
{
|
||||
public:
|
||||
virtual ~FilterInterface() {}
|
||||
virtual ~FilterInterface() = default;
|
||||
|
||||
virtual QStringList filters() const = 0;
|
||||
virtual QImage filterImage(const QString &filter, const QImage &image,
|
||||
|
@ -59,7 +59,7 @@ PaintArea::PaintArea(QWidget *parent) :
|
||||
QWidget(parent)
|
||||
{
|
||||
setAttribute(Qt::WA_StaticContents);
|
||||
setAttribute(Qt::WA_NoBackground);
|
||||
setAttribute(Qt::WA_OpaquePaintEvent);
|
||||
|
||||
theImage.fill(qRgb(255, 255, 255));
|
||||
}
|
||||
|
@ -79,8 +79,6 @@ IconPreviewArea::IconPreviewArea(QWidget *parent)
|
||||
}
|
||||
//! [0]
|
||||
|
||||
#ifdef Q_COMPILER_INITIALIZER_LISTS
|
||||
|
||||
//! [42]
|
||||
QVector<QIcon::Mode> IconPreviewArea::iconModes()
|
||||
{
|
||||
@ -107,44 +105,6 @@ QStringList IconPreviewArea::iconStateNames()
|
||||
}
|
||||
//! [42]
|
||||
|
||||
#else // Q_COMPILER_INITIALIZER_LISTS
|
||||
|
||||
//! [43]
|
||||
QVector<QIcon::Mode> IconPreviewArea::iconModes()
|
||||
{
|
||||
static QVector<QIcon::Mode> result;
|
||||
if (result.isEmpty())
|
||||
result << QIcon::Normal << QIcon::Active << QIcon::Disabled << QIcon::Selected;
|
||||
return result;
|
||||
}
|
||||
//! [43]
|
||||
|
||||
QVector<QIcon::State> IconPreviewArea::iconStates()
|
||||
{
|
||||
static QVector<QIcon::State> result;
|
||||
if (result.isEmpty())
|
||||
result << QIcon::Off << QIcon::On;
|
||||
return result;
|
||||
}
|
||||
|
||||
QStringList IconPreviewArea::iconModeNames()
|
||||
{
|
||||
static QStringList result;
|
||||
if (result.isEmpty())
|
||||
result << tr("Normal") << tr("Active") << tr("Disabled") << tr("Selected");
|
||||
return result;
|
||||
}
|
||||
|
||||
QStringList IconPreviewArea::iconStateNames()
|
||||
{
|
||||
static QStringList result;
|
||||
if (result.isEmpty())
|
||||
result << tr("Off") << tr("On");
|
||||
return result;
|
||||
}
|
||||
|
||||
#endif // !Q_COMPILER_INITIALIZER_LISTS
|
||||
|
||||
//! [1]
|
||||
void IconPreviewArea::setIcon(const QIcon &icon)
|
||||
{
|
||||
|
@ -54,10 +54,10 @@ void parseHtmlFile(QTextStream &out, const QString &fileName)
|
||||
{
|
||||
QFile file(fileName);
|
||||
|
||||
out << "Analysis of HTML file: " << fileName << endl;
|
||||
out << "Analysis of HTML file: " << fileName << Qt::endl;
|
||||
|
||||
if (!file.open(QIODevice::ReadOnly)) {
|
||||
out << " Couldn't open the file." << endl << endl << endl;
|
||||
out << " Couldn't open the file." << Qt::endl << Qt::endl << Qt::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -85,22 +85,22 @@ void parseHtmlFile(QTextStream &out, const QString &fileName)
|
||||
//! [2]
|
||||
if (reader.hasError()) {
|
||||
out << " The HTML file isn't well-formed: " << reader.errorString()
|
||||
<< endl << endl << endl;
|
||||
<< Qt::endl << Qt::endl << Qt::endl;
|
||||
return;
|
||||
}
|
||||
//! [2]
|
||||
|
||||
out << " Title: \"" << title << '"' << endl
|
||||
<< " Number of paragraphs: " << paragraphCount << endl
|
||||
<< " Number of links: " << links.size() << endl
|
||||
<< " Showing first few links:" << endl;
|
||||
out << " Title: \"" << title << '"' << Qt::endl
|
||||
<< " Number of paragraphs: " << paragraphCount << Qt::endl
|
||||
<< " Number of links: " << links.size() << Qt::endl
|
||||
<< " Showing first few links:" << Qt::endl;
|
||||
|
||||
while (links.size() > 5)
|
||||
links.removeLast();
|
||||
|
||||
for (const QString &link : qAsConst(links))
|
||||
out << " " << link << endl;
|
||||
out << endl << endl;
|
||||
out << " " << link << Qt::endl;
|
||||
out << Qt::endl << Qt::endl;
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
|
@ -24,10 +24,6 @@ else: equals(ANDROID_TARGET_ARCH, x86): \
|
||||
QMAKE_CFLAGS += -target i686-none-linux-android -mstackrealign
|
||||
else: equals(ANDROID_TARGET_ARCH, x86_64): \
|
||||
QMAKE_CFLAGS += -target x86_64-none-linux-android
|
||||
else: equals(ANDROID_TARGET_ARCH, mips): \
|
||||
QMAKE_CFLAGS += -target mipsel-none-linux-android
|
||||
else: equals(ANDROID_TARGET_ARCH, mips64): \
|
||||
QMAKE_CFLAGS += -target mips64el-none-linux-android
|
||||
|
||||
QMAKE_CFLAGS += -gcc-toolchain $$NDK_TOOLCHAIN_PATH -fno-limit-debug-info
|
||||
|
||||
|
@ -19,8 +19,6 @@ NDK_TOOLCHAIN_PREFIX = $$(ANDROID_NDK_TOOLCHAIN_PREFIX)
|
||||
isEmpty(NDK_TOOLCHAIN_PREFIX) {
|
||||
equals(ANDROID_TARGET_ARCH, x86): NDK_TOOLCHAIN_PREFIX = x86
|
||||
else: equals(ANDROID_TARGET_ARCH, x86_64): NDK_TOOLCHAIN_PREFIX = x86_64
|
||||
else: equals(ANDROID_TARGET_ARCH, mips): NDK_TOOLCHAIN_PREFIX = mipsel-linux-android
|
||||
else: equals(ANDROID_TARGET_ARCH, mips64): NDK_TOOLCHAIN_PREFIX = mips64el-linux-android
|
||||
else: equals(ANDROID_TARGET_ARCH, arm64-v8a): NDK_TOOLCHAIN_PREFIX = aarch64-linux-android
|
||||
else: NDK_TOOLCHAIN_PREFIX = arm-linux-androideabi
|
||||
}
|
||||
@ -29,8 +27,6 @@ NDK_TOOLS_PREFIX = $$(ANDROID_NDK_TOOLS_PREFIX)
|
||||
isEmpty(NDK_TOOLS_PREFIX) {
|
||||
equals(ANDROID_TARGET_ARCH, x86): NDK_TOOLS_PREFIX = i686-linux-android
|
||||
else: equals(ANDROID_TARGET_ARCH, x86_64): NDK_TOOLS_PREFIX = x86_64-linux-android
|
||||
else: equals(ANDROID_TARGET_ARCH, mips): NDK_TOOLS_PREFIX = mipsel-linux-android
|
||||
else: equals(ANDROID_TARGET_ARCH, mips64): NDK_TOOLS_PREFIX = mips64el-linux-android
|
||||
else: equals(ANDROID_TARGET_ARCH, arm64-v8a): NDK_TOOLS_PREFIX = aarch64-linux-android
|
||||
else: NDK_TOOLS_PREFIX = arm-linux-androideabi
|
||||
}
|
||||
@ -40,8 +36,6 @@ isEmpty(NDK_TOOLCHAIN_VERSION): NDK_TOOLCHAIN_VERSION = $$DEFAULT_ANDROID_NDK_TO
|
||||
|
||||
equals(ANDROID_TARGET_ARCH, x86): ANDROID_ARCHITECTURE = x86
|
||||
else: equals(ANDROID_TARGET_ARCH, x86_64): ANDROID_ARCHITECTURE = x86_64
|
||||
else: equals(ANDROID_TARGET_ARCH, mips): ANDROID_ARCHITECTURE = mips
|
||||
else: equals(ANDROID_TARGET_ARCH, mips64): ANDROID_ARCHITECTURE = mips64
|
||||
else: equals(ANDROID_TARGET_ARCH, arm64-v8a): ANDROID_ARCHITECTURE = arm64
|
||||
else: ANDROID_ARCHITECTURE = arm
|
||||
|
||||
|
@ -69,6 +69,7 @@ QMAKE_LIBDIR_OPENGL =
|
||||
|
||||
QMAKE_LINK_SHLIB = $$QMAKE_LINK
|
||||
QMAKE_LFLAGS = --sysroot=$$ANDROID_PLATFORM_ROOT_PATH
|
||||
equals(ANDROID_TARGET_ARCH, x86_64) QMAKE_LFLAGS += -L$$ANDROID_PLATFORM_ROOT_PATH/usr/lib64
|
||||
QMAKE_LFLAGS_APP = -Wl,--no-undefined -Wl,-z,noexecstack -shared
|
||||
QMAKE_LFLAGS_SHLIB = -Wl,--no-undefined -Wl,-z,noexecstack -shared
|
||||
QMAKE_LFLAGS_PLUGIN = $$QMAKE_LFLAGS_SHLIB
|
||||
|
@ -35,9 +35,11 @@ QMAKE_CXXFLAGS_DISABLE_LTCG = $$QMAKE_CFLAGS_DISABLE_LTCG
|
||||
QMAKE_CXXFLAGS_CXX11 = -std=c++11
|
||||
QMAKE_CXXFLAGS_CXX14 = -std=c++1y
|
||||
QMAKE_CXXFLAGS_CXX1Z = -std=c++1z
|
||||
QMAKE_CXXFLAGS_CXX2A = -std=c++2a
|
||||
QMAKE_CXXFLAGS_GNUCXX11 = -std=gnu++11
|
||||
QMAKE_CXXFLAGS_GNUCXX14 = -std=gnu++1y
|
||||
QMAKE_CXXFLAGS_GNUCXX1Z = -std=gnu++1z
|
||||
QMAKE_CXXFLAGS_GNUCXX2A = -std=gnu++2a
|
||||
|
||||
QMAKE_LFLAGS_CXX11 =
|
||||
QMAKE_LFLAGS_CXX14 =
|
||||
|
@ -32,9 +32,11 @@ QMAKE_CFLAGS_GNUC11 = -std=gnu11
|
||||
QMAKE_CXXFLAGS_CXX11 = -std=c++11
|
||||
QMAKE_CXXFLAGS_CXX14 = -std=c++1y
|
||||
QMAKE_CXXFLAGS_CXX1Z = -std=c++1z
|
||||
QMAKE_CXXFLAGS_CXX2A = -std=c++2a
|
||||
QMAKE_CXXFLAGS_GNUCXX11 = -std=gnu++11
|
||||
QMAKE_CXXFLAGS_GNUCXX14 = -std=gnu++1y
|
||||
QMAKE_CXXFLAGS_GNUCXX1Z = -std=gnu++1z
|
||||
QMAKE_CXXFLAGS_GNUCXX2A = -std=gnu++2a
|
||||
QMAKE_LFLAGS_CXX11 =
|
||||
QMAKE_LFLAGS_CXX14 =
|
||||
QMAKE_LFLAGS_CXX1Z =
|
||||
|
@ -38,7 +38,7 @@ QMAKE_CFLAGS_OPTIMIZE_SIZE = -Os
|
||||
|
||||
!equals(QMAKE_HOST.os, Windows): QMAKE_CFLAGS += -pipe
|
||||
QMAKE_CFLAGS_DEPS += -M
|
||||
QMAKE_CFLAGS_WARN_ON += -Wall -W
|
||||
QMAKE_CFLAGS_WARN_ON += -Wall -Wextra
|
||||
QMAKE_CFLAGS_WARN_OFF += -w
|
||||
QMAKE_CFLAGS_RELEASE += $$QMAKE_CFLAGS_OPTIMIZE
|
||||
QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_CFLAGS_OPTIMIZE -g
|
||||
|
@ -17,7 +17,7 @@ QMAKE_EXTENSION_SHLIB = dylib
|
||||
QMAKE_EXTENSIONS_AUX_SHLIB = tbd
|
||||
QMAKE_LIBDIR =
|
||||
|
||||
# qtConfLibrary_openglMakeSpec will prefix the proper SDK sysroot
|
||||
# sdk.prf will prefix the proper SDK sysroot
|
||||
QMAKE_INCDIR_OPENGL = \
|
||||
/System/Library/Frameworks/OpenGL.framework/Headers \
|
||||
/System/Library/Frameworks/AGL.framework/Headers/
|
||||
|
@ -116,6 +116,8 @@ greaterThan(QMAKE_MSC_VER, 1910) {
|
||||
greaterThan(QMAKE_MSC_VER, 1919) {
|
||||
# Visual Studio 2019 (16.0) / Visual C++ 19.20 and up
|
||||
MSVC_VER = 16.0
|
||||
QMAKE_CXXFLAGS_CXX2A = -std:c++latest
|
||||
|
||||
}
|
||||
|
||||
!isEmpty(COMPAT_MKSPEC):!$$COMPAT_MKSPEC: CONFIG += $$COMPAT_MKSPEC
|
||||
|
73
mkspecs/common/rtems-base.conf
Normal file
@ -0,0 +1,73 @@
|
||||
#
|
||||
# Base qmake configuration for GCC on RTEMS
|
||||
#
|
||||
#
|
||||
#
|
||||
MAKEFILE_GENERATOR = UNIX
|
||||
|
||||
QMAKE_PLATFORM = rtems
|
||||
|
||||
include(unix.conf)
|
||||
include(gcc-base-unix.conf)
|
||||
include(g++-unix.conf)
|
||||
|
||||
rtems_bsp = $$(RTEMS_BSP)
|
||||
isEmpty(rtems_bsp) {
|
||||
error("This qmakespec requires $RTEMS_BSP to be set")
|
||||
}
|
||||
|
||||
rtems_compiler = $$(RTEMS_COMPILER)
|
||||
isEmpty(rtems_compiler) {
|
||||
error("This qmakespec requires $RTEMS_COMPILER to be set")
|
||||
}
|
||||
|
||||
isEmpty(RTEMS_CPU_FLAGS) {
|
||||
error("The qmakespec is expected to set \$\$RTEMS_CPU_FLAGS")
|
||||
}
|
||||
|
||||
RTEMS_FLAGS = \
|
||||
-B$$rtems_bsp \
|
||||
-specs bsp_specs \
|
||||
-qrtems \
|
||||
$$RTEMS_CPU_FLAGS
|
||||
|
||||
QMAKE_CFLAGS_OPTIMIZE_FULL = $$QMAKE_CFLAGS_OPTIMIZE
|
||||
QMAKE_CFLAGS_OPTIMIZE_DEBUG = -O0 -g
|
||||
|
||||
QMAKE_CFLAGS_DEBUG = $$QMAKE_CFLAGS_OPTIMIZE_DEBUG
|
||||
QMAKE_CFLAGS_WARN_ON = -Wall
|
||||
QMAKE_CFLAGS_PIC =
|
||||
QMAKE_CFLAGS_SHLIB =
|
||||
QMAKE_CFLAGS_STATIC_LIB =
|
||||
QMAKE_CFLAGS_APP =
|
||||
QMAKE_CFLAGS += $$RTEMS_FLAGS
|
||||
|
||||
QMAKE_CXXFLAGS_DEBUG = $$QMAKE_CFLAGS_DEBUG
|
||||
QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON
|
||||
QMAKE_CXXFLAGS_SHLIB =
|
||||
QMAKE_CXXFLAGS_STATIC_LIB =
|
||||
QMAKE_CXXFLAGS_APP =
|
||||
QMAKE_CXXFLAGS += $$RTEMS_FLAGS
|
||||
|
||||
QMAKE_CXXFLAGS_CXX11 =
|
||||
QMAKE_CXXFLAGS_CXX14 =
|
||||
QMAKE_CXXFLAGS_CXX1Z =
|
||||
|
||||
QMAKE_LFLAGS_GCSECTIONS = -Wl,--gc-sections
|
||||
QMAKE_LFLAGS += $$RTEMS_FLAGS $$QMAKE_LFLAGS_GCSECTIONS
|
||||
|
||||
QMAKE_CC = $${rtems_compiler}-gcc
|
||||
QMAKE_CXX = $${rtems_compiler}-g++
|
||||
QMAKE_AR = $${rtems_compiler}-ar cqs
|
||||
QMAKE_OBJCOPY = $${rtems_compiler}-objcopy
|
||||
QMAKE_NM = $${rtems_compiler}-nm -P
|
||||
QMAKE_RANLIB = $${rtems_compiler}-ranlib
|
||||
QMAKE_STRIP = $${rtems_compiler}-strip
|
||||
|
||||
QMAKE_LINK_C = $$QMAKE_CC
|
||||
QMAKE_LINK_C_SHLIB =
|
||||
|
||||
QMAKE_LINK = $$QMAKE_CXX
|
||||
QMAKE_LINK_SHLIB =
|
||||
|
||||
load(qt_config)
|
70
mkspecs/common/rtems/qplatformdefs.h
Normal file
@ -0,0 +1,70 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2018 The Qt Company. All rights reserved.
|
||||
** Contact: https://www.qt.io/licensing/
|
||||
**
|
||||
** This file is part of the qmake spec of the Qt Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
** Commercial License Usage
|
||||
** Licensees holding valid commercial Qt licenses may use this file in
|
||||
** accordance with the commercial license agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and The Qt Company. For licensing terms
|
||||
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||
** information use the contact form at https://www.qt.io/contact-us.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 3 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL3 included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 3 requirements
|
||||
** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 2.0 or (at your option) the GNU General
|
||||
** Public license version 3 or any later version approved by the KDE Free
|
||||
** Qt Foundation. The licenses are as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
|
||||
** included in the packaging of this file. Please review the following
|
||||
** information to ensure the GNU General Public License requirements will
|
||||
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
|
||||
** https://www.gnu.org/licenses/gpl-3.0.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef Q_RTEMS_PLATFORMDEFS_H
|
||||
#define Q_RTEMS_PLATFORMDEFS_H
|
||||
|
||||
// Get Qt defines/settings
|
||||
|
||||
#include "qglobal.h"
|
||||
|
||||
#include <pthread.h>
|
||||
#include <dirent.h>
|
||||
#include <fcntl.h>
|
||||
#include <signal.h>
|
||||
#include <sys/select.h>
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
#include <pwd.h>
|
||||
#include <grp.h>
|
||||
|
||||
#include "../posix/qplatformdefs.h"
|
||||
|
||||
|
||||
#ifdef __STRICT_ANSI__
|
||||
#undef __STRICT_ANSI__
|
||||
#endif
|
||||
|
||||
#undef QT_OPEN_LARGEFILE
|
||||
#define QT_OPEN_LARGEFILE 0
|
||||
|
||||
#endif // Q_RTEMS_PLATFORMDEFS_H
|
@ -1,5 +1,2 @@
|
||||
# Pick up the VULKAN_SDK env var set by the LunarG SDK so that the Vulkan
|
||||
# headers are found out-of-the-box on typical Windows setups.
|
||||
|
||||
QMAKE_INCDIR_VULKAN = $$(VULKAN_SDK)\\include
|
||||
load(windows_vulkan_sdk)
|
||||
QMAKE_LIBS_VULKAN =
|
||||
|
@ -25,8 +25,6 @@ contains(TEMPLATE, ".*app"):!build_pass:!android-embedded {
|
||||
isEmpty(NDK_TOOLCHAIN_PREFIX) {
|
||||
equals(ANDROID_TARGET_ARCH, x86): NDK_TOOLCHAIN_PREFIX = x86
|
||||
else: equals(ANDROID_TARGET_ARCH, x86_64): NDK_TOOLCHAIN_PREFIX = x86_64
|
||||
else: equals(ANDROID_TARGET_ARCH, mips): NDK_TOOLCHAIN_PREFIX = mipsel-linux-android
|
||||
else: equals(ANDROID_TARGET_ARCH, mips64): NDK_TOOLCHAIN_PREFIX = mips64el-linux-android
|
||||
else: equals(ANDROID_TARGET_ARCH, arm64-v8a): NDK_TOOLCHAIN_PREFIX = aarch64-linux-android
|
||||
else: NDK_TOOLCHAIN_PREFIX = arm-linux-androideabi
|
||||
}
|
||||
|
@ -26,20 +26,29 @@ contains(CMAKE_INSTALL_LIBS_DIR, ^(/usr)?/lib(64)?.*): CMAKE_USR_MOVE_WORKAROUND
|
||||
|
||||
CMAKE_OUT_DIR = $$MODULE_BASE_OUTDIR/lib/cmake
|
||||
|
||||
# Core, Network, an external module named Foo
|
||||
CMAKE_MODULE_NAME = $$cmakeModuleName($${MODULE})
|
||||
|
||||
# QtCore, QtNetwork, still Foo
|
||||
CMAKE_INCLUDE_NAME = $$eval(QT.$${MODULE}.name)
|
||||
|
||||
# TARGET here is the one changed at the end of qt_module.prf,
|
||||
# which already contains the Qt5 prefix and QT_LIBINFIX suffix :
|
||||
# Qt5Core_suffix, Qt5Network_suffix, Foo_suffix
|
||||
# (or QtCore_suffix, Foo_suffix on macos with -framework)
|
||||
CMAKE_QT_STEM = $${TARGET}
|
||||
|
||||
!generated_privates {
|
||||
isEmpty(SYNCQT.INJECTED_PRIVATE_HEADER_FILES):isEmpty(SYNCQT.PRIVATE_HEADER_FILES): \
|
||||
CMAKE_NO_PRIVATE_INCLUDES = true
|
||||
}
|
||||
|
||||
split_incpath {
|
||||
CMAKE_ADD_SOURCE_INCLUDE_DIRS = true
|
||||
CMAKE_SOURCE_INCLUDES = \
|
||||
$$cmakeTargetPaths($$QT_MODULE_INCLUDE_BASE $$QT_MODULE_INCLUDE_BASE/Qt$${CMAKE_MODULE_NAME})
|
||||
$$cmakeTargetPaths($$QT_MODULE_INCLUDE_BASE $$QT_MODULE_INCLUDE_BASE/$${CMAKE_INCLUDE_NAME})
|
||||
CMAKE_SOURCE_PRIVATE_INCLUDES = \
|
||||
$$cmakeTargetPaths($$QT_MODULE_INCLUDE_BASE/Qt$${CMAKE_MODULE_NAME}/$$eval(QT.$${MODULE}.VERSION) \
|
||||
$$QT_MODULE_INCLUDE_BASE/Qt$${CMAKE_MODULE_NAME}/$$eval(QT.$${MODULE}.VERSION)/Qt$${CMAKE_MODULE_NAME})
|
||||
$$cmakeTargetPaths($$QT_MODULE_INCLUDE_BASE/$${CMAKE_INCLUDE_NAME}/$$eval(QT.$${MODULE}.VERSION) \
|
||||
$$QT_MODULE_INCLUDE_BASE/$${CMAKE_INCLUDE_NAME}/$$eval(QT.$${MODULE}.VERSION)/$${CMAKE_INCLUDE_NAME})
|
||||
|
||||
cmake_extra_source_includes.input = $$PWD/data/cmake/ExtraSourceIncludes.cmake.in
|
||||
cmake_extra_source_includes.output = $$CMAKE_OUT_DIR/Qt5$${CMAKE_MODULE_NAME}/ExtraSourceIncludes.cmake
|
||||
@ -200,24 +209,20 @@ CMAKE_QT5_MODULE_DEPS = $$join(lib_deps, ";")
|
||||
CMAKE_INTERFACE_MODULE_DEPS = $$join(aux_mod_deps, ";")
|
||||
CMAKE_INTERFACE_QT5_MODULE_DEPS = $$join(aux_lib_deps, ";")
|
||||
|
||||
# TARGET here is the one changed at the end of qt_module.prf,
|
||||
# which already contains the Qt5 prefix and QT_LIBINFIX suffix
|
||||
CMAKE_QT_STEM = $${TARGET}
|
||||
|
||||
mac {
|
||||
!isEmpty(CMAKE_STATIC_TYPE) {
|
||||
CMAKE_LIB_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}_debug.a
|
||||
CMAKE_LIB_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}.a
|
||||
CMAKE_LIB_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.a
|
||||
|
||||
CMAKE_PRL_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}_debug.prl
|
||||
CMAKE_PRL_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}.prl
|
||||
CMAKE_PRL_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.prl
|
||||
} else {
|
||||
qt_framework {
|
||||
CMAKE_LIB_FILE_LOCATION_DEBUG = Qt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}.framework/Qt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}
|
||||
CMAKE_LIB_FILE_LOCATION_RELEASE = Qt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}.framework/Qt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}
|
||||
CMAKE_LIB_FILE_LOCATION_DEBUG = $${CMAKE_QT_STEM}.framework/$${CMAKE_QT_STEM}
|
||||
CMAKE_LIB_FILE_LOCATION_RELEASE = $${CMAKE_QT_STEM}.framework/$${CMAKE_QT_STEM}
|
||||
CMAKE_BUILD_IS_FRAMEWORK = "true"
|
||||
} else {
|
||||
CMAKE_LIB_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}_debug.$$eval(QT.$${MODULE}.VERSION).dylib
|
||||
CMAKE_LIB_FILE_LOCATION_DEBUG = lib$${CMAKE_QT_STEM}.$$eval(QT.$${MODULE}.VERSION).dylib
|
||||
CMAKE_LIB_FILE_LOCATION_RELEASE = lib$${CMAKE_QT_STEM}.$$eval(QT.$${MODULE}.VERSION).dylib
|
||||
}
|
||||
}
|
||||
|
@ -157,13 +157,13 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
|
||||
!!IF !no_module_headers
|
||||
!!IF !isEmpty(CMAKE_BUILD_IS_FRAMEWORK)
|
||||
set(_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS
|
||||
\"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}Qt$${CMAKE_MODULE_NAME}.framework\"
|
||||
\"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}Qt$${CMAKE_MODULE_NAME}.framework/Headers\"
|
||||
\"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_QT_STEM}.framework\"
|
||||
\"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_QT_STEM}.framework/Headers\"
|
||||
)
|
||||
!!IF isEmpty(CMAKE_NO_PRIVATE_INCLUDES)
|
||||
set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS
|
||||
\"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}Qt$${CMAKE_MODULE_NAME}.framework/Versions/$$section(VERSION, ., 0, 0)/Headers/$$VERSION/\"
|
||||
\"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}Qt$${CMAKE_MODULE_NAME}.framework/Versions/$$section(VERSION, ., 0, 0)/Headers/$$VERSION/$${MODULE_INCNAME}\"
|
||||
\"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_QT_STEM}.framework/Versions/$$section(VERSION, ., 0, 0)/Headers/$$VERSION/\"
|
||||
\"${_qt5$${CMAKE_MODULE_NAME}_install_prefix}/$${CMAKE_LIB_DIR}$${CMAKE_QT_STEM}.framework/Versions/$$section(VERSION, ., 0, 0)/Headers/$$VERSION/$${MODULE_INCNAME}\"
|
||||
)
|
||||
!!ELSE
|
||||
set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS \"\")
|
||||
@ -180,7 +180,7 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
|
||||
set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS \"\")
|
||||
!!ENDIF
|
||||
!!ELSE
|
||||
set(_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS \"$$CMAKE_INCLUDE_DIR\" \"$${CMAKE_INCLUDE_DIR}Qt$${CMAKE_MODULE_NAME}\")
|
||||
set(_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS \"$$CMAKE_INCLUDE_DIR\" \"$${CMAKE_INCLUDE_DIR}$${CMAKE_INCLUDE_NAME}\")
|
||||
!!IF isEmpty(CMAKE_NO_PRIVATE_INCLUDES)
|
||||
set(Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS
|
||||
\"$${CMAKE_INCLUDE_DIR}$${MODULE_INCNAME}/$$VERSION\"
|
||||
|
27
mkspecs/features/data/testserver/Dockerfile
Normal file
@ -0,0 +1,27 @@
|
||||
# This Dockerfile is used to provision the shared scripts (e.g. startup.sh) and configurations. It
|
||||
# relies on the arguments passed by docker-compose file to build additional images for each service.
|
||||
# To lean more how it works, please check the topic "Use multi-stage builds".
|
||||
# https://docs.docker.com/develop/develop-images/multistage-build/
|
||||
|
||||
ARG provisioningImage
|
||||
FROM $provisioningImage as testserver_tier2
|
||||
|
||||
# Add and merge the testdata into service folder
|
||||
ARG serviceDir
|
||||
ARG shareDir=$serviceDir
|
||||
COPY $serviceDir $shareDir service/
|
||||
|
||||
# create the shared script of testserver
|
||||
RUN echo "#!/usr/bin/env bash\n" \
|
||||
"set -ex\n" \
|
||||
"for RUN_CMD; do \$RUN_CMD; done\n" \
|
||||
"service dbus restart\n" \
|
||||
"service avahi-daemon restart\n" \
|
||||
"sleep infinity\n" > startup.sh
|
||||
RUN chmod +x startup.sh
|
||||
|
||||
# rewrite the default configurations of avahi-daemon
|
||||
ARG test_domain
|
||||
RUN sed -i -e "s,#domain-name=local,domain-name=${test_domain:-test-net.qt.local}," \
|
||||
-e "s,#publish-aaaa-on-ipv4=yes,publish-aaaa-on-ipv4=no," \
|
||||
/etc/avahi/avahi-daemon.conf
|
@ -120,16 +120,18 @@ breakpad {
|
||||
}
|
||||
|
||||
c++17: CONFIG += c++1z
|
||||
c++latest: CONFIG *= c++2a c++1z c++14 c++11
|
||||
|
||||
!c++11:!c++14:!c++1z {
|
||||
!c++11:!c++14:!c++1z:!c++2a {
|
||||
# Qt requires C++11 since 5.7, check if we need to force a compiler option
|
||||
QT_COMPILER_STDCXX_no_L = $$replace(QT_COMPILER_STDCXX, "L$", "")
|
||||
!greaterThan(QT_COMPILER_STDCXX_no_L, 199711): CONFIG += c++11
|
||||
}
|
||||
c++11|c++14|c++1z {
|
||||
c++11|c++14|c++1z|c++2a {
|
||||
# Disable special compiler flags for host builds
|
||||
!host_build|!cross_compile {
|
||||
c++1z: cxxstd = CXX1Z
|
||||
c++2a: cxxstd = CXX2A
|
||||
else: c++1z: cxxstd = CXX1Z
|
||||
else: c++14: cxxstd = CXX14
|
||||
else: cxxstd = CXX11
|
||||
} else {
|
||||
|
@ -33,6 +33,13 @@ QMAKE_MAC_SDK_PATH = $$xcodeSDKInfo(Path)
|
||||
QMAKE_MAC_SDK_PLATFORM_PATH = $$xcodeSDKInfo(PlatformPath)
|
||||
QMAKE_MAC_SDK_VERSION = $$xcodeSDKInfo(SDKVersion)
|
||||
|
||||
isEmpty(QMAKE_EXPORT_INCDIR_OPENGL) {
|
||||
QMAKE_EXPORT_INCDIR_OPENGL = $$QMAKE_INCDIR_OPENGL
|
||||
sysrootified =
|
||||
for(val, QMAKE_INCDIR_OPENGL): sysrootified += $${QMAKE_MAC_SDK_PATH}$$val
|
||||
QMAKE_INCDIR_OPENGL = $$sysrootified
|
||||
}
|
||||
|
||||
QMAKESPEC_NAME = $$basename(QMAKESPEC)
|
||||
|
||||
# Resolve SDK version of various tools
|
||||
|
@ -50,10 +50,7 @@ builtin_resources {
|
||||
|
||||
# Install rules
|
||||
qmldir.base = $$qmldir_path
|
||||
# Tools need qmldir and plugins.qmltypes always installed on the file system
|
||||
|
||||
qmldir.files = $$qmldir_file
|
||||
install_qml_files: qmldir.files += $$fq_qml_files
|
||||
qmldir.path = $$[QT_INSTALL_QML]/$$TARGETPATH
|
||||
INSTALLS += qmldir
|
||||
|
||||
@ -65,12 +62,12 @@ INSTALLS += qmlfiles
|
||||
|
||||
!debug_and_release|!build_all|CONFIG(release, debug|release) {
|
||||
!prefix_build {
|
||||
COPIES += qmldir
|
||||
COPIES += qmldir qmlfiles
|
||||
} else {
|
||||
# For non-installed static builds, tools need qmldir and plugins.qmltypes
|
||||
# files in the build dir
|
||||
qmldir2build.files = $$qmldir_file $$fq_aux_qml_files
|
||||
qmldir2build.path = $$DESTDIR
|
||||
COPIES += qmldir2build
|
||||
qml2build.files = $$qmldir_file $$fq_aux_qml_files
|
||||
qml2build.path = $$DESTDIR
|
||||
COPIES += qml2build
|
||||
}
|
||||
}
|
||||
|
@ -145,12 +145,14 @@ import_plugins:qtConfig(static) {
|
||||
# the plugin path. Unknown plugins must rely on the default link path.
|
||||
plug_type = $$eval(QT_PLUGIN.$${plug}.TYPE)
|
||||
!isEmpty(plug_type) {
|
||||
plug_name = $$QMAKE_PREFIX_STATICLIB$${plug}$$qtPlatformTargetSuffix().$$QMAKE_EXTENSION_STATICLIB
|
||||
plug_path = $$eval(QT_PLUGIN.$${plug}.PATH)
|
||||
isEmpty(plug_path): \
|
||||
plug_path = $$[QT_INSTALL_PLUGINS/get]
|
||||
LIBS += -L$$plug_path/$$plug_type
|
||||
LIBS += $$plug_path/$$plug_type/$$plug_name
|
||||
} else {
|
||||
LIBS += -l$${plug}$$qtPlatformTargetSuffix()
|
||||
}
|
||||
LIBS += -l$${plug}$$qtPlatformTargetSuffix()
|
||||
}
|
||||
}
|
||||
|
||||
@ -195,8 +197,6 @@ for(ever) {
|
||||
qtProcessModuleFlags(DEFINES, QT.$${QTLIB}.DEFINES)
|
||||
|
||||
MODULE_INCLUDES -= $$QMAKE_DEFAULT_INCDIRS
|
||||
MODULE_LIBS_ADD = $$MODULE_LIBS
|
||||
MODULE_LIBS_ADD -= $$QMAKE_DEFAULT_LIBDIRS
|
||||
|
||||
# Frameworks shouldn't need include paths, but much code does not use
|
||||
# module-qualified #includes, so by default we add paths which point
|
||||
@ -209,23 +209,17 @@ for(ever) {
|
||||
!isEmpty(MODULE_MODULE) {
|
||||
contains(MODULE_CONFIG, lib_bundle) {
|
||||
framework = $$MODULE_MODULE
|
||||
# Linking frameworks by absolute path does not work.
|
||||
LIBS$$var_sfx += -framework $$framework
|
||||
} else {
|
||||
!isEmpty(MODULE_LIBS_ADD): \
|
||||
LIBS$$var_sfx += -L$$MODULE_LIBS_ADD
|
||||
|
||||
lib = $$MODULE_MODULE$$qtPlatformTargetSuffix()
|
||||
LIBS$$var_sfx += -l$$lib
|
||||
|
||||
contains(MODULE_CONFIG, staticlib): \
|
||||
PRE_TARGETDEPS *= $$MODULE_LIBS/$${QMAKE_PREFIX_STATICLIB}$${lib}.$${QMAKE_EXTENSION_STATICLIB}
|
||||
|
||||
!isEmpty(QMAKE_LSB) {
|
||||
!isEmpty(MODULE_LIBS_ADD): \
|
||||
QMAKE_LFLAGS *= --lsb-libpath=$$MODULE_LIBS_ADD
|
||||
QMAKE_LFLAGS *= --lsb-shared-libs=$$lib
|
||||
QMAKE_LIBDIR *= /opt/lsb/lib
|
||||
win32|contains(MODULE_CONFIG, staticlib) {
|
||||
lib = $$MODULE_LIBS/$$QMAKE_PREFIX_STATICLIB$${lib}.$$QMAKE_EXTENSION_STATICLIB
|
||||
PRE_TARGETDEPS += $$lib
|
||||
} else {
|
||||
lib = $$MODULE_LIBS/$$QMAKE_PREFIX_SHLIB$${lib}.$$QMAKE_EXTENSION_SHLIB
|
||||
}
|
||||
LIBS$$var_sfx += $$lib
|
||||
}
|
||||
}
|
||||
QMAKE_USE$$var_sfx += $$MODULE_USES
|
||||
@ -295,7 +289,8 @@ contains(all_qt_module_deps, qml): \
|
||||
for (key, IMPORTS._KEYS_) {
|
||||
PATH = $$eval(IMPORTS.$${key}.path)
|
||||
PLUGIN = $$eval(IMPORTS.$${key}.plugin)
|
||||
!isEmpty(PATH):!isEmpty(PLUGIN): LIBS *= -L$$PATH -l$${PLUGIN}$$qtPlatformTargetSuffix()
|
||||
!isEmpty(PATH):!isEmpty(PLUGIN): \
|
||||
LIBS += $$PATH/$$QMAKE_PREFIX_STATICLIB$${PLUGIN}$$qtPlatformTargetSuffix().$$QMAKE_EXTENSION_STATICLIB
|
||||
}
|
||||
|
||||
# create qml_plugin_import.cpp
|
||||
|
@ -17,6 +17,7 @@ DEFINES *= QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
|
||||
qtConfig(c++11): CONFIG += c++11 strict_c++
|
||||
qtConfig(c++14): CONFIG += c++14
|
||||
qtConfig(c++1z): CONFIG += c++1z
|
||||
qtConfig(c++2a): CONFIG += c++2a
|
||||
qtConfig(c99): CONFIG += c99
|
||||
qtConfig(c11): CONFIG += c11
|
||||
qtConfig(stack-protector-strong): CONFIG += stack_protector_strong
|
||||
@ -38,6 +39,10 @@ contains(TEMPLATE, .*lib) {
|
||||
qt_libdir = $$[QT_INSTALL_LIBS]
|
||||
}
|
||||
contains(QMAKE_DEFAULT_LIBDIRS, $$qt_libdir) {
|
||||
lib_replace0.match = $$rplbase/lib/
|
||||
lib_replace0.replace = $$qqt_libdir/
|
||||
lib_replace0.CONFIG = path
|
||||
QMAKE_PRL_INSTALL_REPLACE += lib_replace0
|
||||
lib_replace.match = "[^ ']*$$rplbase/lib"
|
||||
lib_replace.replace =
|
||||
} else {
|
||||
@ -89,14 +94,8 @@ clang {
|
||||
greaterThan(QT_GCC_MAJOR_VERSION, 5): QMAKE_CXXFLAGS_WARN_ON += -Wshift-overflow=2 -Wduplicated-cond
|
||||
# GCC 7 has a lot of false positives relating to this, so disable completely
|
||||
greaterThan(QT_GCC_MAJOR_VERSION, 6): QMAKE_CXXFLAGS_WARN_ON += -Wno-stringop-overflow
|
||||
# GCC 9 has a lot of false positives relating to this, so disable completely
|
||||
greaterThan(QT_GCC_MAJOR_VERSION, 8): QMAKE_CXXFLAGS_WARN_ON += -Wno-deprecated-copy
|
||||
# GCC 9 introduced this
|
||||
greaterThan(QT_GCC_MAJOR_VERSION, 8): QMAKE_CXXFLAGS_WARN_ON += -Wno-redundant-move
|
||||
# GCC 9 introduced this
|
||||
# GCC 9 introduced -Wformat-overflow in -Wall, but it is buggy:
|
||||
greaterThan(QT_GCC_MAJOR_VERSION, 8): QMAKE_CXXFLAGS_WARN_ON += -Wno-format-overflow
|
||||
# GCC 9 introduced this
|
||||
greaterThan(QT_GCC_MAJOR_VERSION, 8): QMAKE_CXXFLAGS_WARN_ON += -Wno-init-list-lifetime
|
||||
}
|
||||
|
||||
warnings_are_errors:warning_clean {
|
||||
@ -136,14 +135,13 @@ warnings_are_errors:warning_clean {
|
||||
|
||||
# GCC 7 includes -Wimplicit-fallthrough in -Wextra, but Qt is not yet free of implicit fallthroughs.
|
||||
greaterThan(QT_GCC_MAJOR_VERSION, 6): QMAKE_CXXFLAGS_WARN_ON += -Wno-error=implicit-fallthrough
|
||||
# GCC 9 has a lot of false positives relating to this, so disable completely
|
||||
greaterThan(QT_GCC_MAJOR_VERSION, 8): QMAKE_CXXFLAGS_WARN_ON += -Wno-deprecated-copy
|
||||
# GCC 9 introduced -Wdeprecated-copy in -Wextra, but we are not clean for it.
|
||||
greaterThan(QT_GCC_MAJOR_VERSION, 8): QMAKE_CXXFLAGS_WARN_ON += -Wno-error=deprecated-copy
|
||||
# GCC 9 introduced this
|
||||
greaterThan(QT_GCC_MAJOR_VERSION, 8): QMAKE_CXXFLAGS_WARN_ON += -Wno-redundant-move
|
||||
greaterThan(QT_GCC_MAJOR_VERSION, 8): QMAKE_CXXFLAGS_WARN_ON += -Wno-error=redundant-move
|
||||
# GCC 9 introduced this
|
||||
greaterThan(QT_GCC_MAJOR_VERSION, 8): QMAKE_CXXFLAGS_WARN_ON += -Wno-format-overflow
|
||||
# GCC 9 introduced this
|
||||
greaterThan(QT_GCC_MAJOR_VERSION, 8): QMAKE_CXXFLAGS_WARN_ON += -Wno-init-list-lifetime
|
||||
greaterThan(QT_GCC_MAJOR_VERSION, 8): QMAKE_CXXFLAGS_WARN_ON += -Wno-error=init-list-lifetime
|
||||
|
||||
# Work-around for bug https://code.google.com/p/android/issues/detail?id=58135
|
||||
android: QMAKE_CXXFLAGS_WARN_ON += -Wno-error=literal-suffix
|
||||
}
|
||||
|
@ -526,6 +526,17 @@ defineTest(qtConfSetupLibraries) {
|
||||
}
|
||||
}
|
||||
|
||||
defineReplace(qtGccSysrootifiedPath) {
|
||||
return($$replace(1, ^=, $$[QT_SYSROOT]))
|
||||
}
|
||||
|
||||
defineReplace(qtGccSysrootifiedPaths) {
|
||||
sysrootified =
|
||||
for (path, 1): \
|
||||
sysrootified += $$qtGccSysrootifiedPath($$path)
|
||||
return($$sysrootified)
|
||||
}
|
||||
|
||||
# libs-var, libs, in-paths, out-paths-var
|
||||
defineTest(qtConfResolveLibs) {
|
||||
ret = true
|
||||
@ -542,6 +553,7 @@ defineTest(qtConfResolveLibs) {
|
||||
out += $$l
|
||||
} else: contains(l, "^-L.*") {
|
||||
lp = $$replace(l, "^-L", )
|
||||
gcc: lp = $$qtGccSysrootifiedPath($$lp)
|
||||
!exists($$lp/.) {
|
||||
qtLog("Library path $$val_escape(lp) is invalid.")
|
||||
ret = false
|
||||
@ -615,6 +627,7 @@ defineTest(qtConfResolveAllLibs) {
|
||||
# libs-var, in-paths, libs
|
||||
defineTest(qtConfResolvePathLibs) {
|
||||
ret = true
|
||||
gcc: 2 = $$qtGccSysrootifiedPaths($$2)
|
||||
for (libdir, 2) {
|
||||
!exists($$libdir/.) {
|
||||
qtLog("Library path $$val_escape(libdir) is invalid.")
|
||||
@ -665,6 +678,7 @@ defineReplace(qtConfGetTestIncludes) {
|
||||
# includes-var, in-paths, test-object-var
|
||||
defineTest(qtConfResolvePathIncs) {
|
||||
ret = true
|
||||
gcc: 2 = $$qtGccSysrootifiedPaths($$2)
|
||||
for (incdir, 2) {
|
||||
!exists($$incdir/.) {
|
||||
qtLog("Include path $$val_escape(incdir) is invalid.")
|
||||
@ -783,6 +797,11 @@ defineTest(qtConfLibrary_makeSpec) {
|
||||
!qtConfResolvePathIncs($${1}.includedir, $$eval(QMAKE_INCDIR_$$spec), $$2): \
|
||||
return(false)
|
||||
|
||||
!isEmpty(QMAKE_EXPORT_INCDIR_$$spec) {
|
||||
$${1}.exportincludedir = $$eval(QMAKE_EXPORT_INCDIR_$$spec)
|
||||
export($${1}.exportincludedir)
|
||||
}
|
||||
|
||||
# note that the object is re-exported, because we resolve the libraries.
|
||||
|
||||
return(true)
|
||||
@ -950,8 +969,11 @@ defineTest(qtConfExportLibrary) {
|
||||
}
|
||||
defines = $$eval($${spfx}.defines)
|
||||
!isEmpty(defines): qtConfOutputVar(assign, $$output, QMAKE_DEFINES_$$NAME, $$defines)
|
||||
includes = $$eval($${spfx}.includedir)
|
||||
!isEmpty(includes): qtConfOutputVar(assign, $$output, QMAKE_INCDIR_$$NAME, $$includes)
|
||||
includes = $$eval($${spfx}.exportincludedir)
|
||||
!equals(includes, -) {
|
||||
isEmpty(includes): includes = $$eval($${spfx}.includedir)
|
||||
!isEmpty(includes): qtConfOutputVar(assign, $$output, QMAKE_INCDIR_$$NAME, $$includes)
|
||||
}
|
||||
uses = $$eval($${lpfx}.dependencies)
|
||||
!isEmpty(uses) {
|
||||
# FIXME: ideally, we would export transitive deps only for static
|
||||
|
@ -264,7 +264,7 @@ load(qt_installs)
|
||||
load(qt_targets)
|
||||
|
||||
# this builds on top of qt_common
|
||||
!internal_module:if(unix|mingw) {
|
||||
!internal_module:if(unix|mingw):!if(darwin:debug_and_release:CONFIG(debug, debug|release)) {
|
||||
CONFIG += create_pc
|
||||
QMAKE_PKGCONFIG_DESTDIR = pkgconfig
|
||||
host_build: \
|
||||
@ -277,11 +277,13 @@ load(qt_targets)
|
||||
} else {
|
||||
QMAKE_PKGCONFIG_INCDIR = $$[QT_INSTALL_HEADERS/raw]
|
||||
QMAKE_PKGCONFIG_CFLAGS = -D$$MODULE_DEFINE -I${includedir}/$$MODULE_INCNAME
|
||||
for(inc, MODULE_AUX_INCLUDES): \
|
||||
QMAKE_PKGCONFIG_CFLAGS += -I${includedir}/$$section(inc, /, 1, 1)
|
||||
}
|
||||
QMAKE_PKGCONFIG_NAME = $$replace(TARGET, ^Qt, "Qt$$QT_MAJOR_VERSION ")
|
||||
QMAKE_PKGCONFIG_FILE = $$replace(TARGET, ^Qt, Qt$$QT_MAJOR_VERSION)
|
||||
QMAKE_PKGCONFIG_FILE = $$replace(TARGET, ^Qt, Qt$$QT_MAJOR_VERSION)$$qtPlatformTargetSuffix()
|
||||
for(i, MODULE_DEPENDS): \
|
||||
QMAKE_PKGCONFIG_REQUIRES += $$replace(QT.$${i}.name, ^Qt, Qt$$section(QT.$${i}.VERSION, ., 0, 0))
|
||||
QMAKE_PKGCONFIG_REQUIRES += $$replace(QT.$${i}.name, ^Qt, Qt$$section(QT.$${i}.VERSION, ., 0, 0))$$qtPlatformTargetSuffix()
|
||||
isEmpty(QMAKE_PKGCONFIG_DESCRIPTION): \
|
||||
QMAKE_PKGCONFIG_DESCRIPTION = $$replace(TARGET, ^Qt, "Qt ") module
|
||||
pclib_replace.match = $$lib_replace.match
|
||||
@ -317,5 +319,6 @@ win32 {
|
||||
# On other platforms, Qt's own compilation goes needs to compile the Qt 5.0 API
|
||||
DEFINES *= QT_DISABLE_DEPRECATED_BEFORE=0x050000
|
||||
}
|
||||
DEFINES *= QT_DEPRECATED_WARNINGS_SINCE=0x060000
|
||||
|
||||
TARGET = $$qt5LibraryTarget($$TARGET$$QT_LIBINFIX) # Do this towards the end
|
||||
|
@ -23,7 +23,7 @@ load(qt_build_paths)
|
||||
QMAKE_SYNCQT += -module $$mod
|
||||
QMAKE_SYNCQT += \
|
||||
-version $$VERSION -outdir $$system_quote($$MODULE_BASE_OUTDIR) \
|
||||
-builddir $$system_quote($$shadowed($$MODULE_BASE_INDIR)) $$MODULE_SYNCQT_DIR
|
||||
-builddir $$system_quote($$REAL_MODULE_BASE_OUTDIR) $$MODULE_SYNCQT_DIR
|
||||
!silent: message($$QMAKE_SYNCQT)
|
||||
system($$QMAKE_SYNCQT)|error("Failed to run: $$QMAKE_SYNCQT")
|
||||
|
||||
|
@ -60,8 +60,12 @@ defineReplace(qtExportLibsForModule) {
|
||||
QMAKE_LIBS_$$NAME QMAKE_LIBS_$${NAME}_DEBUG QMAKE_LIBS_$${NAME}_RELEASE \
|
||||
QMAKE_DEFINES_$$NAME QMAKE_INCDIR_$$NAME
|
||||
for (var, vars) {
|
||||
defined($$var, var): \
|
||||
result += "$$var = $$val_escape($$var)"
|
||||
expvar = $$var
|
||||
expvar ~= s/^QMAKE_/QMAKE_EXPORT_/
|
||||
defined($$expvar, var):equals($$expvar, -): next()
|
||||
!defined($$expvar, var): expvar = $$var
|
||||
defined($$expvar, var): \
|
||||
result += "$$var = $$val_escape($$expvar)"
|
||||
}
|
||||
}
|
||||
return($$result)
|
||||
|
@ -91,6 +91,7 @@ CONFIG(static, static|shared)|prefix_build {
|
||||
target.path = $$[QT_INSTALL_PLUGINS]/$$PLUGIN_TYPE
|
||||
INSTALLS += target
|
||||
|
||||
qt_libinfix_plugins: TARGET = $$TARGET$$QT_LIBINFIX
|
||||
TARGET = $$qt5LibraryTarget($$TARGET)
|
||||
|
||||
CONFIG += create_cmake
|
||||
|
@ -267,9 +267,13 @@ isEmpty($${target_prefix}.INCDIRS) {
|
||||
for (line, output) {
|
||||
contains(line, "^libraries: .*") {
|
||||
line ~= s,^libraries: ,,
|
||||
# clang (7.x) on Windows uses the wrong path list separator ...
|
||||
equals(QMAKE_HOST.os, Windows): line ~= s,:(?![/\\\\]),;,
|
||||
paths = $$split(line, $$QMAKE_DIRLIST_SEP)
|
||||
equals(QMAKE_HOST.os, Windows) {
|
||||
# clang (7.x) on Windows uses the wrong path list separator ...
|
||||
line ~= s,:(?![/\\\\]),;,
|
||||
paths = $$split(line, ;)
|
||||
} else {
|
||||
paths = $$split(line, $$QMAKE_DIRLIST_SEP)
|
||||
}
|
||||
for (path, paths): \
|
||||
QMAKE_DEFAULT_LIBDIRS += $$clean_path($$replace(path, ^=, $$[SYSROOT]))
|
||||
}
|
||||
|
@ -102,6 +102,7 @@ isEmpty(TESTSERVER_VERSION) {
|
||||
# The environment variables passed to the docker-compose file
|
||||
TEST_ENV = 'MACHINE_IP=$(shell docker-machine ip qt-test-server)'
|
||||
TEST_ENV += 'TEST_DOMAIN=$$DNSDOMAIN'
|
||||
TEST_ENV += 'SHARED_DATA=$$PWD/../data/testserver'
|
||||
TEST_CMD = env
|
||||
} else:equals(QMAKE_HOST.os, Windows) {
|
||||
# There is no docker bridge on Windows. It is impossible to ping a container.
|
||||
@ -115,6 +116,7 @@ isEmpty(TESTSERVER_VERSION) {
|
||||
# The environment variables passed to the docker-compose file
|
||||
TEST_ENV = '\$\$env:MACHINE_IP = docker-machine ip qt-test-server;'
|
||||
TEST_ENV += '\$\$env:TEST_DOMAIN = $$shell_quote(\"$$DNSDOMAIN\");'
|
||||
TEST_ENV += '\$\$env:SHARED_DATA = $$shell_quote(\"$$PWD/../data/testserver\");'
|
||||
|
||||
# Docker-compose CLI environment variables:
|
||||
# Enable path conversion from Windows-style to Unix-style in volume definitions.
|
||||
@ -127,6 +129,7 @@ isEmpty(TESTSERVER_VERSION) {
|
||||
$$dirname(_QMAKE_CONF_)/tests/testserver/docker-compose.yml
|
||||
# The environment variables passed to the docker-compose file
|
||||
TEST_ENV = 'TEST_DOMAIN=$$DNSDOMAIN'
|
||||
TEST_ENV += 'SHARED_DATA=$$PWD/../data/testserver'
|
||||
TEST_CMD = env
|
||||
}
|
||||
!exists($$TESTSERVER_COMPOSE_FILE): error("Invalid TESTSERVER_COMPOSE_FILE specified")
|
||||
@ -200,7 +203,7 @@ isEmpty(TESTSERVER_VERSION) {
|
||||
# Bring up test servers and make sure the services are ready.
|
||||
!isEmpty(TEST_CMD): testserver_test.commands = $$TEST_CMD $$TEST_ENV
|
||||
testserver_test.commands += docker-compose $$MACHINE_CONFIG -f $$TESTSERVER_COMPOSE_FILE up \
|
||||
--detach --force-recreate --timeout 1 $${QT_TEST_SERVER_LIST} &&
|
||||
--build -d --force-recreate --timeout 1 $${QT_TEST_SERVER_LIST} &&
|
||||
|
||||
# Check test cases with docker-based test servers.
|
||||
testserver_test.commands += $(MAKE) -f $(MAKEFILE) check_network &&
|
@ -67,7 +67,7 @@ contains(TEMPLATE, .*app) {
|
||||
# replacing the app name placeholder with the actual app name.
|
||||
apphtml.name = application main html file
|
||||
apphtml.output = $$DESTDIR/$$TARGET_HTML
|
||||
apphtml.commands = sed -e s/APPNAME/$$TARGET_BASE/g $$WASM_PLUGIN_PATH/wasm_shell.html > $$DESTDIR/$$TARGET_HTML
|
||||
apphtml.commands = sed -e s/@APPNAME@/$$TARGET_BASE/g $$WASM_PLUGIN_PATH/wasm_shell.html > $$DESTDIR/$$TARGET_HTML
|
||||
apphtml.input = $$WASM_PLUGIN_PATH/wasm_shell.html
|
||||
apphtml.depends = $$apphtml.input
|
||||
QMAKE_EXTRA_COMPILERS += apphtml
|
||||
|
@ -1,13 +1,21 @@
|
||||
QT_FOR_CONFIG += gui
|
||||
|
||||
defineTest(prependOpenGlLib) {
|
||||
path = $$QT.core.libs/$$QMAKE_PREFIX_STATICLIB$$1
|
||||
ext = .$$QMAKE_EXTENSION_STATICLIB
|
||||
QMAKE_LIBS_OPENGL_ES2 = $${path}$${ext} $$QMAKE_LIBS_OPENGL_ES2
|
||||
QMAKE_LIBS_OPENGL_ES2_DEBUG = $${path}d$${ext} $$QMAKE_LIBS_OPENGL_ES2_DEBUG
|
||||
export(QMAKE_LIBS_OPENGL_ES2)
|
||||
export(QMAKE_LIBS_OPENGL_ES2_DEBUG)
|
||||
}
|
||||
|
||||
qtConfig(opengles2) {
|
||||
# Depending on the configuration we use libQtANGLE or libEGL and libGLESv2
|
||||
qtConfig(combined-angle-lib) {
|
||||
QMAKE_LIBS_OPENGL_ES2 = -l$${LIBQTANGLE_NAME} $$QMAKE_LIBS_OPENGL_ES2
|
||||
QMAKE_LIBS_OPENGL_ES2_DEBUG = -l$${LIBQTANGLE_NAME}d $$QMAKE_LIBS_OPENGL_ES2_DEBUG
|
||||
prependOpenGlLib($$LIBQTANGLE_NAME)
|
||||
} else {
|
||||
QMAKE_LIBS_OPENGL_ES2 = -l$${LIBEGL_NAME} -l$${LIBGLESV2_NAME} $$QMAKE_LIBS_OPENGL_ES2
|
||||
QMAKE_LIBS_OPENGL_ES2_DEBUG = -l$${LIBEGL_NAME}d -l$${LIBGLESV2_NAME}d $$QMAKE_LIBS_OPENGL_ES2_DEBUG
|
||||
prependOpenGlLib($$LIBGLESV2_NAME)
|
||||
prependOpenGlLib($$LIBEGL_NAME)
|
||||
}
|
||||
# For Desktop, use the ANGLE library location passed on from configure.
|
||||
INCLUDEPATH += $$QMAKE_INCDIR_OPENGL_ES2
|
||||
|
@ -6,10 +6,9 @@ contains(TEMPLATE, ".*app") {
|
||||
|
||||
qt:for(entryLib, $$list($$unique(QMAKE_LIBS_QT_ENTRY))) {
|
||||
isEqual(entryLib, -lqtmain) {
|
||||
!contains(QMAKE_DEFAULT_LIBDIRS, $$QT.core.libs): \
|
||||
QMAKE_LIBS += -L$$QT.core.libs
|
||||
CONFIG(debug, debug|release): QMAKE_LIBS += $${entryLib}$${QT_LIBINFIX}d
|
||||
else: QMAKE_LIBS += $${entryLib}$${QT_LIBINFIX}
|
||||
lib = $$QT.core.libs/$${QMAKE_PREFIX_STATICLIB}qtmain$$QT_LIBINFIX$$qtPlatformTargetSuffix().$$QMAKE_EXTENSION_STATICLIB
|
||||
PRE_TARGETDEPS += $$lib
|
||||
QMAKE_LIBS += $$lib
|
||||
} else {
|
||||
QMAKE_LIBS += $${entryLib}
|
||||
}
|
||||
|
8
mkspecs/features/win32/windows_vulkan_sdk.prf
Normal file
@ -0,0 +1,8 @@
|
||||
isEmpty(QMAKE_INCDIR_VULKAN) {
|
||||
# Pick up the VULKAN_SDK env var set by the LunarG SDK so that the Vulkan
|
||||
# headers are found out-of-the-box on typical Windows setups.
|
||||
QMAKE_INCDIR_VULKAN = $$(VULKAN_SDK)\\include
|
||||
|
||||
# Do not export the include dir but resolve it on every qmake call.
|
||||
QMAKE_EXPORT_INCDIR_VULKAN = -
|
||||
}
|
@ -13,7 +13,6 @@ load(qt_config)
|
||||
|
||||
QMAKE_LIBS_THREAD += -lrt
|
||||
|
||||
QMAKE_LSB = 1
|
||||
QMAKE_CC = lsbcc
|
||||
QMAKE_CXX = lsbc++
|
||||
|
||||
|
178
qmake/.prev_CMakeLists.txt
Normal file
@ -0,0 +1,178 @@
|
||||
# Generated from qmake.pro.
|
||||
|
||||
#####################################################################
|
||||
## qmake Binary:
|
||||
#####################################################################
|
||||
|
||||
add_qt_executable(qmake
|
||||
SOURCES
|
||||
../src/corelib/codecs/qutfcodec.cpp ../src/corelib/codecs/qutfcodec_p.h
|
||||
../src/corelib/global/qglobal.cpp ../src/corelib/global/qglobal.h
|
||||
../src/corelib/global/qlibraryinfo.cpp
|
||||
../src/corelib/global/qlogging.cpp
|
||||
../src/corelib/global/qmalloc.cpp
|
||||
../src/corelib/global/qnumeric.cpp ../src/corelib/global/qnumeric.h
|
||||
../src/corelib/io/qabstractfileengine.cpp ../src/corelib/io/qabstractfileengine_p.h
|
||||
../src/corelib/io/qbuffer.cpp ../src/corelib/io/qbuffer.h
|
||||
../src/corelib/io/qdir.cpp ../src/corelib/io/qdir.h ../src/corelib/io/qdir_p.h
|
||||
../src/corelib/io/qdiriterator.cpp ../src/corelib/io/qdiriterator.h
|
||||
../src/corelib/io/qfile.cpp ../src/corelib/io/qfile.h
|
||||
../src/corelib/io/qfiledevice.cpp
|
||||
../src/corelib/io/qfileinfo.cpp ../src/corelib/io/qfileinfo.h
|
||||
../src/corelib/io/qfilesystemengine.cpp
|
||||
../src/corelib/io/qfilesystementry.cpp
|
||||
../src/corelib/io/qfsfileengine.cpp
|
||||
../src/corelib/io/qfsfileengine_iterator.cpp
|
||||
../src/corelib/io/qiodevice.cpp ../src/corelib/io/qiodevice.h
|
||||
../src/corelib/io/qsettings.cpp
|
||||
../src/corelib/io/qtemporaryfile.cpp ../src/corelib/io/qtemporaryfile.h
|
||||
../src/corelib/kernel/qmetatype.cpp ../src/corelib/kernel/qmetatype.h
|
||||
../src/corelib/kernel/qsystemerror.cpp ../src/corelib/kernel/qsystemerror_p.h
|
||||
../src/corelib/kernel/qvariant.cpp
|
||||
../src/corelib/plugin/quuid.cpp ../src/corelib/plugin/quuid.h
|
||||
../src/corelib/serialization/qjson.cpp ../src/corelib/serialization/qjson_p.h
|
||||
../src/corelib/serialization/qjsonarray.cpp ../src/corelib/serialization/qjsonarray.h
|
||||
../src/corelib/serialization/qjsondocument.cpp ../src/corelib/serialization/qjsondocument.h
|
||||
../src/corelib/serialization/qjsonobject.cpp ../src/corelib/serialization/qjsonobject.h
|
||||
../src/corelib/serialization/qjsonparser.cpp ../src/corelib/serialization/qjsonparser_p.h
|
||||
../src/corelib/serialization/qjsonvalue.cpp ../src/corelib/serialization/qjsonvalue.h
|
||||
../src/corelib/serialization/qjsonwriter_p.h
|
||||
../src/corelib/serialization/qtextstream.cpp ../src/corelib/serialization/qtextstream.h
|
||||
../src/corelib/serialization/qxmlstream.cpp ../src/corelib/serialization/qxmlstream.h
|
||||
../src/corelib/serialization/qxmlutils.cpp ../src/corelib/serialization/qxmlutils_p.h
|
||||
../src/corelib/tools/qarraydata.cpp ../src/corelib/tools/qarraydata.h
|
||||
../src/corelib/tools/qarraydataops.h
|
||||
../src/corelib/tools/qarraydatapointer.h
|
||||
../src/corelib/tools/qbitarray.cpp ../src/corelib/tools/qbitarray.h
|
||||
../src/corelib/tools/qbytearray.cpp ../src/corelib/tools/qbytearray.h
|
||||
../src/corelib/tools/qbytearraymatcher.cpp ../src/corelib/tools/qbytearraymatcher.h
|
||||
../src/corelib/tools/qchar.h
|
||||
../src/corelib/tools/qcryptographichash.cpp ../src/corelib/tools/qcryptographichash.h
|
||||
../src/corelib/tools/qdatetime.cpp ../src/corelib/tools/qdatetime.h ../src/corelib/tools/qdatetime_p.h
|
||||
../src/corelib/tools/qhash.cpp ../src/corelib/tools/qhash.h
|
||||
../src/corelib/tools/qlist.cpp ../src/corelib/tools/qlist.h
|
||||
../src/corelib/tools/qlocale.cpp ../src/corelib/tools/qlocale.h
|
||||
../src/corelib/tools/qlocale_tools.cpp ../src/corelib/tools/qlocale_tools_p.h
|
||||
../src/corelib/tools/qmap.cpp ../src/corelib/tools/qmap.h
|
||||
../src/corelib/tools/qregexp.cpp ../src/corelib/tools/qregexp.h
|
||||
../src/corelib/tools/qstring.cpp ../src/corelib/tools/qstring.h
|
||||
../src/corelib/tools/qstring_compat.cpp
|
||||
../src/corelib/tools/qstringlist.cpp ../src/corelib/tools/qstringlist.h
|
||||
../src/corelib/tools/qstringmatcher.h
|
||||
../src/corelib/tools/qvector.h
|
||||
../src/corelib/tools/qversionnumber.cpp ../src/corelib/tools/qversionnumber.h
|
||||
../src/corelib/tools/qvsnprintf.cpp
|
||||
cachekeys.h
|
||||
generators/mac/pbuilder_pbx.cpp generators/mac/pbuilder_pbx.h
|
||||
generators/makefile.cpp generators/makefile.h
|
||||
generators/makefiledeps.cpp generators/makefiledeps.h
|
||||
generators/metamakefile.cpp generators/metamakefile.h
|
||||
generators/projectgenerator.cpp generators/projectgenerator.h
|
||||
generators/unix/unixmake.cpp generators/unix/unixmake.h
|
||||
generators/unix/unixmake2.cpp
|
||||
generators/win32/mingw_make.cpp generators/win32/mingw_make.h
|
||||
generators/win32/msbuild_objectmodel.cpp generators/win32/msbuild_objectmodel.h
|
||||
generators/win32/msvc_nmake.cpp generators/win32/msvc_nmake.h
|
||||
generators/win32/msvc_objectmodel.cpp generators/win32/msvc_objectmodel.h
|
||||
generators/win32/msvc_vcproj.cpp generators/win32/msvc_vcproj.h
|
||||
generators/win32/msvc_vcxproj.cpp generators/win32/msvc_vcxproj.h
|
||||
generators/win32/winmakefile.cpp generators/win32/winmakefile.h
|
||||
generators/xmloutput.cpp generators/xmloutput.h
|
||||
library/ioutils.cpp library/ioutils.h
|
||||
library/proitems.cpp library/proitems.h
|
||||
library/qmake_global.h
|
||||
library/qmakebuiltins.cpp
|
||||
library/qmakeevaluator.cpp library/qmakeevaluator.h library/qmakeevaluator_p.h
|
||||
library/qmakeglobals.cpp library/qmakeglobals.h
|
||||
library/qmakeparser.cpp library/qmakeparser.h
|
||||
library/qmakevfs.cpp library/qmakevfs.h
|
||||
main.cpp
|
||||
meta.cpp meta.h
|
||||
option.cpp option.h
|
||||
project.cpp project.h
|
||||
property.cpp property.h
|
||||
DEFINES
|
||||
=\"\"
|
||||
PROEVALUATOR_FULL
|
||||
QT_BOOTSTRAPPED
|
||||
QT_BUILD_QMAKE
|
||||
QT_NO_FOREACH
|
||||
QT_VERSION_MAJOR=
|
||||
QT_VERSION_MINOR=
|
||||
QT_VERSION_PATCH=
|
||||
INCLUDE_DIRECTORIES
|
||||
.
|
||||
../include
|
||||
../include/QtCore ../include/QtCore
|
||||
../include/QtCore//QtCore
|
||||
../src/corelib/global
|
||||
generators
|
||||
generators/mac
|
||||
generators/unix
|
||||
generators/win32
|
||||
library
|
||||
)
|
||||
|
||||
#### Keys ignored in scope 1:.:.:qmake.pro:<TRUE>:
|
||||
# CONFIG = "cmdline" "-qt"
|
||||
# PRECOMPILED_HEADER = "qmake_pch.h"
|
||||
# _OPTION = "host_build"
|
||||
|
||||
## Scopes:
|
||||
#####################################################################
|
||||
|
||||
extend_target(qmake CONDITION WIN32
|
||||
SOURCES
|
||||
../src/corelib/global/qoperatingsystemversion_win.cpp
|
||||
../src/corelib/io/qfilesystemengine_win.cpp
|
||||
../src/corelib/io/qfilesystemiterator_win.cpp
|
||||
../src/corelib/io/qfsfileengine_win.cpp
|
||||
../src/corelib/io/qsettings_win.cpp
|
||||
../src/corelib/plugin/qsystemlibrary.cpp
|
||||
../src/corelib/tools/qlocale_win.cpp
|
||||
registry.cpp-NOTFOUND
|
||||
DEFINES
|
||||
UNICODE
|
||||
_CRT_SECURE_NO_WARNINGS
|
||||
_ENABLE_EXTENDED_ALIGNED_STORAGE
|
||||
_SCL_SECURE_NO_WARNINGS
|
||||
PUBLIC_LIBRARIES
|
||||
advapi32
|
||||
kernel32
|
||||
netapi32
|
||||
ole32
|
||||
)
|
||||
|
||||
extend_target(qmake CONDITION UNIX
|
||||
SOURCES
|
||||
../src/corelib/io/qfilesystemengine_unix.cpp
|
||||
../src/corelib/io/qfilesystemiterator_unix.cpp
|
||||
../src/corelib/io/qfsfileengine_unix.cpp
|
||||
../src/corelib/kernel/qcore_unix.cpp
|
||||
../src/corelib/tools/qlocale_unix.cpp
|
||||
)
|
||||
|
||||
extend_target(qmake CONDITION APPLE_OSX
|
||||
SOURCES
|
||||
qcore_foundation.mm
|
||||
qcore_mac.cpp
|
||||
qoperatingsystemversion_darwin.mm
|
||||
qsettings_mac.cpp
|
||||
PUBLIC_LIBRARIES
|
||||
${FWApplicationServices}
|
||||
${FWCoreServices}
|
||||
${FWFoundation}
|
||||
COMPILE_OPTIONS
|
||||
-fconstant-cfstrings
|
||||
)
|
||||
|
||||
extend_target(qmake CONDITION WIN32 AND mingw
|
||||
PUBLIC_LIBRARIES
|
||||
uuid
|
||||
)
|
||||
|
||||
extend_target(qmake CONDITION CLANG AND WIN32
|
||||
COMPILE_OPTIONS
|
||||
-Wno-microsoft-enum-value
|
||||
-fms-compatibility-version=19.00.23506
|
||||
)
|
@ -67,7 +67,6 @@ add_qt_tool(qmake # special case
|
||||
../src/corelib/tools/qcryptographichash.cpp ../src/corelib/tools/qcryptographichash.h
|
||||
../src/corelib/tools/qdatetime.cpp ../src/corelib/tools/qdatetime.h ../src/corelib/tools/qdatetime_p.h
|
||||
../src/corelib/tools/qhash.cpp ../src/corelib/tools/qhash.h
|
||||
../src/corelib/tools/qlinkedlist.cpp ../src/corelib/tools/qlinkedlist.h
|
||||
../src/corelib/tools/qlist.cpp ../src/corelib/tools/qlist.h
|
||||
../src/corelib/tools/qlocale.cpp ../src/corelib/tools/qlocale.h
|
||||
../src/corelib/tools/qlocale_tools.cpp ../src/corelib/tools/qlocale_tools_p.h
|
||||
@ -123,9 +122,10 @@ add_qt_tool(qmake # special case
|
||||
# . # special case
|
||||
library
|
||||
generators
|
||||
generators/mac
|
||||
generators/unix
|
||||
generators/win32
|
||||
generators/mac
|
||||
library
|
||||
$<TARGET_PROPERTY:Qt::CorePrivate,INTERFACE_INCLUDE_DIRECTORIES> # special case
|
||||
${CMAKE_BINARY_DIR}/src/corelib/global # special case: for qconfig.cpp
|
||||
)
|
||||
@ -152,8 +152,8 @@ extend_target(qmake CONDITION WIN32
|
||||
library/registry.cpp # special case
|
||||
DEFINES
|
||||
UNICODE
|
||||
_ENABLE_EXTENDED_ALIGNED_STORAGE
|
||||
_CRT_SECURE_NO_WARNINGS
|
||||
_ENABLE_EXTENDED_ALIGNED_STORAGE
|
||||
_SCL_SECURE_NO_WARNINGS
|
||||
PUBLIC_LIBRARIES
|
||||
advapi32
|
||||
|
@ -28,7 +28,7 @@ QOBJS = \
|
||||
qmetatype.o qsystemerror.o qvariant.o \
|
||||
quuid.o \
|
||||
qarraydata.o qbitarray.o qbytearray.o qbytearraymatcher.o \
|
||||
qcryptographichash.o qdatetime.o qhash.o qlinkedlist.o qlist.o \
|
||||
qcryptographichash.o qdatetime.o qhash.o qlist.o \
|
||||
qlocale.o qlocale_tools.o qmap.o qregexp.o qringbuffer.o \
|
||||
qstringbuilder.o qstring_compat.o qstring.o qstringlist.o qversionnumber.o \
|
||||
qvsnprintf.o qxmlstream.o qxmlutils.o \
|
||||
@ -112,7 +112,6 @@ DEPEND_SRC = \
|
||||
$(SOURCE_PATH)/src/corelib/tools/qcryptographichash.cpp \
|
||||
$(SOURCE_PATH)/src/corelib/tools/qdatetime.cpp \
|
||||
$(SOURCE_PATH)/src/corelib/tools/qhash.cpp \
|
||||
$(SOURCE_PATH)/src/corelib/tools/qlinkedlist.cpp \
|
||||
$(SOURCE_PATH)/src/corelib/tools/qlist.cpp \
|
||||
$(SOURCE_PATH)/src/corelib/tools/qlocale.cpp \
|
||||
$(SOURCE_PATH)/src/corelib/tools/qlocale_tools.cpp \
|
||||
@ -442,9 +441,6 @@ qmap.o: $(SOURCE_PATH)/src/corelib/tools/qmap.cpp
|
||||
qhash.o: $(SOURCE_PATH)/src/corelib/tools/qhash.cpp
|
||||
$(CXX) -c -o $@ $(CXXFLAGS) $<
|
||||
|
||||
qlinkedlist.o: $(SOURCE_PATH)/src/corelib/tools/qlinkedlist.cpp
|
||||
$(CXX) -c -o $@ $(CXXFLAGS) $<
|
||||
|
||||
qcryptographichash.o: $(SOURCE_PATH)/src/corelib/tools/qcryptographichash.cpp
|
||||
$(CXX) -c -o $@ $(CXXFLAGS) $<
|
||||
|
||||
|
@ -88,7 +88,6 @@ QTOBJS= \
|
||||
qringbuffer.obj \
|
||||
qdebug.obj \
|
||||
qlist.obj \
|
||||
qlinkedlist.obj \
|
||||
qlocale.obj \
|
||||
qlocale_tools.obj \
|
||||
qlocale_win.obj \
|
||||
|
@ -974,6 +974,12 @@
|
||||
the compiler does not support C++17, or can't select the C++ standard.
|
||||
By default, support is disabled.
|
||||
\row \li c++17 \li Same as c++1z.
|
||||
\row \li c++2a \li C++2a support is enabled. This option has no effect if
|
||||
the compiler does not support C++2a, or can't select the C++ standard.
|
||||
By default, support is disabled.
|
||||
\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.
|
||||
\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
|
||||
@ -1105,6 +1111,8 @@
|
||||
\header \li Option \li Description
|
||||
\row \li app_bundle \li Puts the executable into a bundle (this is the default).
|
||||
\row \li lib_bundle \li Puts the library into a library bundle.
|
||||
\row \li plugin_bundle \li Puts the plugin into a plugin bundle. This value
|
||||
is not supported by the Xcode project generator.
|
||||
\endtable
|
||||
|
||||
The build process for bundles is also influenced by
|
||||
@ -1146,8 +1154,9 @@
|
||||
\target DEPENDPATH
|
||||
\section1 DEPENDPATH
|
||||
|
||||
Specifies a list of all directories to look in to resolve dependencies. This
|
||||
variable is used when crawling through \c included files.
|
||||
Specifies a list of directories for qmake to scan, to resolve dependencies.
|
||||
This variable is used when qmake crawls through the header files that you
|
||||
\c{#include} in your source code.
|
||||
|
||||
\target DESTDIR
|
||||
\section1 DESTDIR
|
||||
@ -1158,6 +1167,10 @@
|
||||
|
||||
\snippet code/doc_src_qmake-manual.pro 30
|
||||
|
||||
\note The list of supported characters can depend on
|
||||
the used build tool. In particular, parentheses do not
|
||||
work with \c{make}.
|
||||
|
||||
\target DISTFILES
|
||||
\section1 DISTFILES
|
||||
|
||||
@ -1271,6 +1284,41 @@
|
||||
|
||||
\snippet code/doc_src_qmake-manual.pro 36
|
||||
|
||||
\c INSTALLS has a \c{.CONFIG} member that can take several values:
|
||||
|
||||
\table
|
||||
\header
|
||||
\li Value
|
||||
\li Description
|
||||
\row
|
||||
\li no_check_exists
|
||||
\li If not set, qmake looks to see if the files to install actually
|
||||
exist. If these files don't exist, qmake doesn’t create the
|
||||
install rule. Use this config value if you need to install
|
||||
files that are generated as part of your build process, like
|
||||
HTML files created by qdoc.
|
||||
\row
|
||||
\li nostrip
|
||||
\li If set, the typical Unix strip functionality is turned off and
|
||||
the debug information will remain in the binary.
|
||||
\row
|
||||
\li executable
|
||||
\li On Unix, this sets the executable flag.
|
||||
\row
|
||||
\li no_build
|
||||
\li When you do a \c{make install}, and you don't have a build of
|
||||
the project yet, the project is first built, and then installed.
|
||||
If you don't want this behavior, set this config value to ensure
|
||||
that the build target is not added as a dependency to the install
|
||||
target.
|
||||
\row
|
||||
\li no_default_install
|
||||
\li A project has a top-level project target where, when you do a
|
||||
\c{make install}, everything is installed. But, if you have an
|
||||
install target with this config value set, it's not installed by
|
||||
default. You then have to explicitly say \c{make install_<file>}.
|
||||
\endtable
|
||||
|
||||
For more information, see \l{Installing Files}.
|
||||
|
||||
This variable is also used to specify which additional files will be
|
||||
@ -1580,6 +1628,14 @@
|
||||
The value of this variable is typically handled by qmake or \l{#QMAKESPEC}{qmake.conf}
|
||||
and rarely needs to be modified.
|
||||
|
||||
\target QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO
|
||||
\section1 QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO
|
||||
|
||||
Specifies the C compiler flags for release builds where
|
||||
\c{force_debug_info} is set in \c{CONFIG}.
|
||||
The value of this variable is typically handled by
|
||||
qmake or \l{#QMAKESPEC}{qmake.conf} and rarely needs to be modified.
|
||||
|
||||
\target QMAKE_CFLAGS_SHLIB
|
||||
\section1 QMAKE_CFLAGS_SHLIB
|
||||
|
||||
@ -1648,6 +1704,14 @@
|
||||
The value of this variable is typically handled by
|
||||
qmake or \l{#QMAKESPEC}{qmake.conf} and rarely needs to be modified.
|
||||
|
||||
\target QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO
|
||||
\section1 QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO
|
||||
|
||||
Specifies the C++ compiler flags for release builds where
|
||||
\c{force_debug_info} is set in \c{CONFIG}.
|
||||
The value of this variable is typically handled by
|
||||
qmake or \l{#QMAKESPEC}{qmake.conf} and rarely needs to be modified.
|
||||
|
||||
\target QMAKE_CXXFLAGS_SHLIB
|
||||
\section1 QMAKE_CXXFLAGS_SHLIB
|
||||
|
||||
@ -2028,6 +2092,12 @@
|
||||
The value of this variable is typically handled by
|
||||
qmake or \l{#QMAKESPEC}{qmake.conf} and rarely needs to be modified.
|
||||
|
||||
\section1 QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO
|
||||
|
||||
Specifies the linker flags for release builds where \c{force_debug_info} is
|
||||
set in \c{CONFIG}. The value of this variable is typically handled by
|
||||
qmake or \l{#QMAKESPEC}{qmake.conf} and rarely needs to be modified.
|
||||
|
||||
\section1 QMAKE_LFLAGS_APP
|
||||
|
||||
Specifies the linker flags for building applications.
|
||||
@ -4508,7 +4578,10 @@
|
||||
\c QMAKEFEATURES environment variable)
|
||||
\li \c $$QMAKEFEATURES/myfeatures.prf (for each directory listed in the
|
||||
\c QMAKEFEATURES property variable)
|
||||
\li \c myfeatures.prf (in the project's root directory)
|
||||
\li \c myfeatures.prf (in the project's root directory). The project root
|
||||
is determined by the top-level \c{.pro} file. However, if you place the
|
||||
\c{.qmake.cache} file in a sub-directory or the directory of a
|
||||
sub-project, then the project root becomes the sub-directory itself.
|
||||
\li \c $QMAKEPATH/mkspecs/features/unix/myfeatures.prf and
|
||||
\c $QMAKEPATH/mkspecs/features/myfeatures.prf (for each directory
|
||||
listed in the \c QMAKEPATH environment variable)
|
||||
@ -4813,6 +4886,7 @@
|
||||
\li Unix
|
||||
\list
|
||||
\li GCC 3.4 and above
|
||||
\li clang
|
||||
\endlist
|
||||
\endlist
|
||||
|
||||
|
@ -60,11 +60,6 @@ static QString qtSha1(const QByteArray &src)
|
||||
return QString::fromLatin1(digest.toHex());
|
||||
}
|
||||
|
||||
ProjectBuilderMakefileGenerator::ProjectBuilderMakefileGenerator() : UnixMakefileGenerator()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
bool
|
||||
ProjectBuilderMakefileGenerator::writeMakefile(QTextStream &t)
|
||||
{
|
||||
@ -541,7 +536,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
|
||||
debug_msg(1, "pbuilder: Creating file: %s", mkfile.toLatin1().constData());
|
||||
QTextStream mkt(&mkf);
|
||||
writeHeader(mkt);
|
||||
mkt << "QMAKE = " << var("QMAKE_QMAKE") << endl;
|
||||
mkt << "QMAKE = " << var("QMAKE_QMAKE") << Qt::endl;
|
||||
project->values("QMAKE_MAKE_QMAKE_EXTRA_COMMANDS")
|
||||
<< "@echo 'warning: Xcode project has been regenerated, custom settings have been lost. " \
|
||||
"Use CONFIG+=no_autoqmake to prevent this behavior in the future, " \
|
||||
@ -740,15 +735,15 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
|
||||
debug_msg(1, "pbuilder: Creating file: %s", mkfile.toLatin1().constData());
|
||||
QTextStream mkt(&mkf);
|
||||
writeHeader(mkt);
|
||||
mkt << "MOC = " << var("QMAKE_MOC") << endl;
|
||||
mkt << "UIC = " << var("QMAKE_UIC") << endl;
|
||||
mkt << "LEX = " << var("QMAKE_LEX") << endl;
|
||||
mkt << "LEXFLAGS = " << var("QMAKE_LEXFLAGS") << endl;
|
||||
mkt << "YACC = " << var("QMAKE_YACC") << endl;
|
||||
mkt << "YACCFLAGS = " << var("QMAKE_YACCFLAGS") << endl;
|
||||
mkt << "MOC = " << var("QMAKE_MOC") << Qt::endl;
|
||||
mkt << "UIC = " << var("QMAKE_UIC") << Qt::endl;
|
||||
mkt << "LEX = " << var("QMAKE_LEX") << Qt::endl;
|
||||
mkt << "LEXFLAGS = " << var("QMAKE_LEXFLAGS") << Qt::endl;
|
||||
mkt << "YACC = " << var("QMAKE_YACC") << Qt::endl;
|
||||
mkt << "YACCFLAGS = " << var("QMAKE_YACCFLAGS") << Qt::endl;
|
||||
mkt << "DEFINES = "
|
||||
<< varGlue("PRL_EXPORT_DEFINES","-D"," -D"," ")
|
||||
<< varGlue("DEFINES","-D"," -D","") << endl;
|
||||
<< varGlue("DEFINES","-D"," -D","") << Qt::endl;
|
||||
mkt << "INCPATH =";
|
||||
{
|
||||
const ProStringList &incs = project->values("INCLUDEPATH");
|
||||
@ -757,9 +752,9 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
|
||||
}
|
||||
if(!project->isEmpty("QMAKE_FRAMEWORKPATH_FLAGS"))
|
||||
mkt << " " << var("QMAKE_FRAMEWORKPATH_FLAGS");
|
||||
mkt << endl;
|
||||
mkt << "DEL_FILE = " << var("QMAKE_DEL_FILE") << endl;
|
||||
mkt << "MOVE = " << var("QMAKE_MOVE") << endl << endl;
|
||||
mkt << Qt::endl;
|
||||
mkt << "DEL_FILE = " << var("QMAKE_DEL_FILE") << Qt::endl;
|
||||
mkt << "MOVE = " << var("QMAKE_MOVE") << Qt::endl << Qt::endl;
|
||||
mkt << "preprocess: compilers\n";
|
||||
mkt << "clean preprocess_clean: compiler_clean\n\n";
|
||||
writeExtraTargets(mkt);
|
||||
@ -789,7 +784,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
|
||||
}
|
||||
}
|
||||
}
|
||||
mkt << endl;
|
||||
mkt << Qt::endl;
|
||||
writeExtraCompilerTargets(mkt);
|
||||
writingUnixMakefileGenerator = false;
|
||||
}
|
||||
@ -994,12 +989,12 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
|
||||
tmp = project->values("SUBLIBS");
|
||||
for(int i = 0; i < tmp.count(); i++)
|
||||
t << escapeFilePath("tmp/lib" + tmp[i] + ".a") << ' ';
|
||||
t << endl << endl;
|
||||
t << Qt::endl << Qt::endl;
|
||||
mkt << "sublibs: $(SUBLIBS)\n\n";
|
||||
tmp = project->values("SUBLIBS");
|
||||
for(int i = 0; i < tmp.count(); i++)
|
||||
t << escapeFilePath("tmp/lib" + tmp[i] + ".a") + ":\n\t"
|
||||
<< var(ProKey("MAKELIB" + tmp[i])) << endl << endl;
|
||||
<< var(ProKey("MAKELIB" + tmp[i])) << Qt::endl << Qt::endl;
|
||||
mkt.flush();
|
||||
mkf.close();
|
||||
writingUnixMakefileGenerator = false;
|
||||
@ -1236,9 +1231,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
|
||||
<< "\t\t\t" << writeSettings("runOnlyForDeploymentPostprocessing", "0", SettingsNoQuote) << ";\n"
|
||||
<< "\t\t};\n";
|
||||
|
||||
QMapIterator<ProString, ProStringList> it(embedded_plugins);
|
||||
while (it.hasNext()) {
|
||||
it.next();
|
||||
for (auto it = embedded_plugins.cbegin(), end = embedded_plugins.cend(); it != end; ++it) {
|
||||
QString suffix = !it.key().isEmpty() ? (" (" + it.key() + ")") : QString();
|
||||
QString grp3("Embed PlugIns" + suffix), key3 = keyFor(grp3);
|
||||
project->values("QMAKE_PBX_BUILDPHASES").append(key3);
|
||||
|
@ -61,19 +61,12 @@ class ProjectBuilderMakefileGenerator : public UnixMakefileGenerator
|
||||
QString writeSettings(const QString &var, const ProStringList &vals, int flags=0, int indent_level=0);
|
||||
|
||||
public:
|
||||
ProjectBuilderMakefileGenerator();
|
||||
~ProjectBuilderMakefileGenerator();
|
||||
|
||||
bool supportsMetaBuild() override { return false; }
|
||||
bool openOutput(QFile &, const QString &) const override;
|
||||
protected:
|
||||
bool doPrecompiledHeaders() const override { return false; }
|
||||
bool doDepends() const override { return writingUnixMakefileGenerator && UnixMakefileGenerator::doDepends(); }
|
||||
};
|
||||
|
||||
inline ProjectBuilderMakefileGenerator::~ProjectBuilderMakefileGenerator()
|
||||
{ }
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // PBUILDER_PBX_H
|
||||
|
@ -94,13 +94,6 @@ bool MakefileGenerator::mkdir(const QString &in_path) const
|
||||
return QDir().mkpath(path);
|
||||
}
|
||||
|
||||
// ** base makefile generator
|
||||
MakefileGenerator::MakefileGenerator() :
|
||||
no_io(false), project(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
MakefileGenerator::verifyCompilers()
|
||||
{
|
||||
@ -994,25 +987,25 @@ MakefileGenerator::writePrlFile(QTextStream &t)
|
||||
QString bdir = Option::output_dir;
|
||||
if(bdir.isEmpty())
|
||||
bdir = qmake_getpwd();
|
||||
t << "QMAKE_PRL_BUILD_DIR =" << qv(bdir) << endl;
|
||||
t << "QMAKE_PRL_BUILD_DIR =" << qv(bdir) << Qt::endl;
|
||||
|
||||
t << "QMAKE_PRO_INPUT =" << qv(project->projectFile().section('/', -1)) << endl;
|
||||
t << "QMAKE_PRO_INPUT =" << qv(project->projectFile().section('/', -1)) << Qt::endl;
|
||||
|
||||
if(!project->isEmpty("QMAKE_ABSOLUTE_SOURCE_PATH"))
|
||||
t << "QMAKE_PRL_SOURCE_DIR =" << qv(project->first("QMAKE_ABSOLUTE_SOURCE_PATH")) << endl;
|
||||
t << "QMAKE_PRL_TARGET =" << qv(project->first("LIB_TARGET")) << endl;
|
||||
t << "QMAKE_PRL_SOURCE_DIR =" << qv(project->first("QMAKE_ABSOLUTE_SOURCE_PATH")) << Qt::endl;
|
||||
t << "QMAKE_PRL_TARGET =" << qv(project->first("LIB_TARGET")) << Qt::endl;
|
||||
if(!project->isEmpty("PRL_EXPORT_DEFINES"))
|
||||
t << "QMAKE_PRL_DEFINES =" << qv(project->values("PRL_EXPORT_DEFINES")) << endl;
|
||||
t << "QMAKE_PRL_DEFINES =" << qv(project->values("PRL_EXPORT_DEFINES")) << Qt::endl;
|
||||
if(!project->isEmpty("PRL_EXPORT_CFLAGS"))
|
||||
t << "QMAKE_PRL_CFLAGS =" << qv(project->values("PRL_EXPORT_CFLAGS")) << endl;
|
||||
t << "QMAKE_PRL_CFLAGS =" << qv(project->values("PRL_EXPORT_CFLAGS")) << Qt::endl;
|
||||
if(!project->isEmpty("PRL_EXPORT_CXXFLAGS"))
|
||||
t << "QMAKE_PRL_CXXFLAGS =" << qv(project->values("PRL_EXPORT_CXXFLAGS")) << endl;
|
||||
t << "QMAKE_PRL_CXXFLAGS =" << qv(project->values("PRL_EXPORT_CXXFLAGS")) << Qt::endl;
|
||||
if(!project->isEmpty("CONFIG"))
|
||||
t << "QMAKE_PRL_CONFIG =" << qv(project->values("CONFIG")) << endl;
|
||||
t << "QMAKE_PRL_CONFIG =" << qv(project->values("CONFIG")) << Qt::endl;
|
||||
if(!project->isEmpty("TARGET_VERSION_EXT"))
|
||||
t << "QMAKE_PRL_VERSION = " << project->first("TARGET_VERSION_EXT") << endl;
|
||||
t << "QMAKE_PRL_VERSION = " << project->first("TARGET_VERSION_EXT") << Qt::endl;
|
||||
else if(!project->isEmpty("VERSION"))
|
||||
t << "QMAKE_PRL_VERSION = " << project->first("VERSION") << endl;
|
||||
t << "QMAKE_PRL_VERSION = " << project->first("VERSION") << Qt::endl;
|
||||
if(project->isActiveConfig("staticlib") || project->isActiveConfig("explicitlib")) {
|
||||
ProStringList libs;
|
||||
if (!project->isActiveConfig("staticlib"))
|
||||
@ -1022,7 +1015,7 @@ MakefileGenerator::writePrlFile(QTextStream &t)
|
||||
t << "QMAKE_PRL_LIBS =";
|
||||
for (ProStringList::Iterator it = libs.begin(); it != libs.end(); ++it)
|
||||
t << qv(project->values((*it).toKey()));
|
||||
t << endl;
|
||||
t << Qt::endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1053,17 +1046,17 @@ MakefileGenerator::writeProjectMakefile()
|
||||
|
||||
//install
|
||||
t << "install: ";
|
||||
for(it = targets.begin(); it != targets.end(); ++it)
|
||||
t << (*it)->target << "-install ";
|
||||
t << endl;
|
||||
for (SubTarget *s : qAsConst(targets))
|
||||
t << s->target << '-';
|
||||
t << "install " << Qt::endl;
|
||||
|
||||
//uninstall
|
||||
t << "uninstall: ";
|
||||
for(it = targets.begin(); it != targets.end(); ++it)
|
||||
t << (*it)->target << "-uninstall ";
|
||||
t << endl;
|
||||
t << Qt::endl;
|
||||
} else {
|
||||
t << "first: " << targets.first()->target << endl
|
||||
t << "first: " << targets.first()->target << Qt::endl
|
||||
<< "install: " << targets.first()->target << "-install\n"
|
||||
<< "uninstall: " << targets.first()->target << "-uninstall\n";
|
||||
}
|
||||
@ -1072,7 +1065,7 @@ MakefileGenerator::writeProjectMakefile()
|
||||
if(!project->isActiveConfig("no_autoqmake")) {
|
||||
QString mkf = escapeDependencyPath(fileFixify(Option::output.fileName()));
|
||||
for(QList<SubTarget*>::Iterator it = targets.begin(); it != targets.end(); ++it)
|
||||
t << escapeDependencyPath((*it)->makefile) << ": " << mkf << endl;
|
||||
t << escapeDependencyPath((*it)->makefile) << ": " << mkf << Qt::endl;
|
||||
}
|
||||
qDeleteAll(targets);
|
||||
return true;
|
||||
@ -1186,7 +1179,7 @@ MakefileGenerator::writeObj(QTextStream &t, const char *src)
|
||||
p.replace(stringObj, escapeFilePath(dstf));
|
||||
t << "\n\t" << p;
|
||||
}
|
||||
t << endl << endl;
|
||||
t << Qt::endl << Qt::endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1380,14 +1373,14 @@ MakefileGenerator::writeInstalls(QTextStream &t, bool noBuild)
|
||||
QString tmp_dst = fileFixify((*pit).toQString(), FileFixifyAbsolute, false);
|
||||
t << mkdir_p_asstring(filePrefixRoot(root, tmp_dst)) << "\n\t";
|
||||
}
|
||||
t << target << endl << endl;
|
||||
t << target << Qt::endl << Qt::endl;
|
||||
if(!uninst.isEmpty()) {
|
||||
t << "uninstall_" << (*it) << ": FORCE";
|
||||
for (int i = uninst.size(); --i >= 0; )
|
||||
t << "\n\t" << uninst.at(i);
|
||||
t << "\n\t-$(DEL_DIR) " << escapeFilePath(filePrefixRoot(root, dst)) << " \n\n";
|
||||
}
|
||||
t << endl;
|
||||
t << Qt::endl;
|
||||
|
||||
if (installConfigValues.indexOf("no_default_install") == -1) {
|
||||
all_installs += QString("install_") + (*it) + " ";
|
||||
@ -1824,7 +1817,7 @@ MakefileGenerator::writeExtraTargets(QTextStream &t)
|
||||
t << escapeDependencyPath(targ) << ":" << deps;
|
||||
if(!cmd.isEmpty())
|
||||
t << "\n\t" << cmd;
|
||||
t << endl << endl;
|
||||
t << Qt::endl << Qt::endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1916,7 +1909,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
|
||||
FileFixifyFromOutdir));
|
||||
}
|
||||
}
|
||||
t << endl;
|
||||
t << Qt::endl;
|
||||
|
||||
if (config.indexOf("no_clean") == -1) {
|
||||
QStringList raw_clean = project->values(ProKey(*it + ".clean")).toQStringList();
|
||||
@ -1981,7 +1974,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
|
||||
}
|
||||
}
|
||||
}
|
||||
t << endl;
|
||||
t << Qt::endl;
|
||||
}
|
||||
QStringList tmp_dep = project->values(ProKey(*it + ".depends")).toQStringList();
|
||||
if (config.indexOf("combine") != -1) {
|
||||
@ -2002,14 +1995,11 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
|
||||
QString dep_cmd = replaceExtraCompilerVariables(tmp_dep_cmd, inpf, tmp_out, LocalShell);
|
||||
dep_cmd = dep_cd_cmd + fixEnvVariables(dep_cmd);
|
||||
if (FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), QT_POPEN_READ)) {
|
||||
QString indeps;
|
||||
while(!feof(proc)) {
|
||||
int read_in = (int)fread(buff, 1, 255, proc);
|
||||
if(!read_in)
|
||||
break;
|
||||
indeps += QByteArray(buff, read_in);
|
||||
}
|
||||
QByteArray depData;
|
||||
while (int read_in = feof(proc) ? 0 : (int)fread(buff, 1, 255, proc))
|
||||
depData.append(buff, read_in);
|
||||
QT_PCLOSE(proc);
|
||||
const QString indeps = QString::fromLocal8Bit(depData);
|
||||
if(!indeps.isEmpty()) {
|
||||
QDir outDir(Option::output_dir);
|
||||
QStringList dep_cmd_deps = splitDeps(indeps, dep_lines);
|
||||
@ -2065,7 +2055,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
|
||||
} else {
|
||||
t << " " << valList(escapeDependencyPaths(inputs)) << " " << valList(finalizeDependencyPaths(deps));
|
||||
}
|
||||
t << "\n\t" << cmd << endl << endl;
|
||||
t << "\n\t" << cmd << Qt::endl << Qt::endl;
|
||||
continue;
|
||||
}
|
||||
for (ProStringList::ConstIterator input = tmp_inputs.cbegin(); input != tmp_inputs.cend(); ++input) {
|
||||
@ -2090,14 +2080,11 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
|
||||
QString dep_cmd = replaceExtraCompilerVariables(tmp_dep_cmd, inpf, out, LocalShell);
|
||||
dep_cmd = dep_cd_cmd + fixEnvVariables(dep_cmd);
|
||||
if (FILE *proc = QT_POPEN(dep_cmd.toLatin1().constData(), QT_POPEN_READ)) {
|
||||
QString indeps;
|
||||
while(!feof(proc)) {
|
||||
int read_in = (int)fread(buff, 1, 255, proc);
|
||||
if(!read_in)
|
||||
break;
|
||||
indeps += QByteArray(buff, read_in);
|
||||
}
|
||||
QByteArray depData;
|
||||
while (int read_in = feof(proc) ? 0 : (int)fread(buff, 1, 255, proc))
|
||||
depData.append(buff, read_in);
|
||||
QT_PCLOSE(proc);
|
||||
const QString indeps = QString::fromLocal8Bit(depData);
|
||||
if(!indeps.isEmpty()) {
|
||||
QDir outDir(Option::output_dir);
|
||||
QStringList dep_cmd_deps = splitDeps(indeps, dep_lines);
|
||||
@ -2177,10 +2164,10 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
|
||||
++i;
|
||||
}
|
||||
t << escapeDependencyPath(out) << ": " << valList(finalizeDependencyPaths(deps)) << "\n\t"
|
||||
<< cmd << endl << endl;
|
||||
<< cmd << Qt::endl << Qt::endl;
|
||||
}
|
||||
}
|
||||
t << "compiler_clean: " << clean_targets << endl << endl;
|
||||
t << "compiler_clean: " << clean_targets << Qt::endl << Qt::endl;
|
||||
}
|
||||
|
||||
void
|
||||
@ -2196,17 +2183,17 @@ MakefileGenerator::writeExtraCompilerVariables(QTextStream &t)
|
||||
first = false;
|
||||
}
|
||||
t << "QMAKE_COMP_" << (*varit) << " = "
|
||||
<< valList(project->values((*varit).toKey())) << endl;
|
||||
<< valList(project->values((*varit).toKey())) << Qt::endl;
|
||||
}
|
||||
}
|
||||
if(!first)
|
||||
t << endl;
|
||||
t << Qt::endl;
|
||||
}
|
||||
|
||||
void
|
||||
MakefileGenerator::writeExtraVariables(QTextStream &t)
|
||||
{
|
||||
t << endl;
|
||||
t << Qt::endl;
|
||||
|
||||
ProStringList outlist;
|
||||
const ProValueMap &vars = project->variables();
|
||||
@ -2220,7 +2207,7 @@ MakefileGenerator::writeExtraVariables(QTextStream &t)
|
||||
}
|
||||
if (!outlist.isEmpty()) {
|
||||
t << "####### Custom Variables\n";
|
||||
t << outlist.join('\n') << endl << endl;
|
||||
t << outlist.join('\n') << Qt::endl << Qt::endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2236,11 +2223,11 @@ MakefileGenerator::writeExportedVariables(QTextStream &t)
|
||||
const ProString &name = project->first(ProKey(exp + ".name"));
|
||||
const ProString &value = project->first(ProKey(exp + ".value"));
|
||||
if (!value.isEmpty())
|
||||
t << name << " = " << value << endl;
|
||||
t << name << " = " << value << Qt::endl;
|
||||
else
|
||||
t << name << " =\n";
|
||||
}
|
||||
t << endl;
|
||||
t << Qt::endl;
|
||||
}
|
||||
|
||||
bool
|
||||
@ -2248,7 +2235,7 @@ MakefileGenerator::writeDummyMakefile(QTextStream &t)
|
||||
{
|
||||
if (project->values("QMAKE_FAILED_REQUIREMENTS").isEmpty())
|
||||
return false;
|
||||
t << "QMAKE = " << var("QMAKE_QMAKE") << endl;
|
||||
t << "QMAKE = " << var("QMAKE_QMAKE") << Qt::endl;
|
||||
const ProStringList &qut = project->values("QMAKE_EXTRA_TARGETS");
|
||||
for (ProStringList::ConstIterator it = qut.begin(); it != qut.end(); ++it)
|
||||
t << *it << " ";
|
||||
@ -2264,7 +2251,7 @@ MakefileGenerator::writeDummyMakefile(QTextStream &t)
|
||||
bool
|
||||
MakefileGenerator::writeStubMakefile(QTextStream &t)
|
||||
{
|
||||
t << "QMAKE = " << var("QMAKE_QMAKE") << endl;
|
||||
t << "QMAKE = " << var("QMAKE_QMAKE") << Qt::endl;
|
||||
const ProStringList &qut = project->values("QMAKE_EXTRA_TARGETS");
|
||||
for (ProStringList::ConstIterator it = qut.begin(); it != qut.end(); ++it)
|
||||
t << *it << " ";
|
||||
@ -2293,22 +2280,22 @@ MakefileGenerator::writeMakefile(QTextStream &t)
|
||||
void
|
||||
MakefileGenerator::writeDefaultVariables(QTextStream &t)
|
||||
{
|
||||
t << "QMAKE = " << var("QMAKE_QMAKE") << endl;
|
||||
t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << endl;
|
||||
t << "CHK_DIR_EXISTS= " << var("QMAKE_CHK_DIR_EXISTS") << endl;
|
||||
t << "MKDIR = " << var("QMAKE_MKDIR") << endl;
|
||||
t << "COPY = " << var("QMAKE_COPY") << endl;
|
||||
t << "COPY_FILE = " << var("QMAKE_COPY_FILE") << endl;
|
||||
t << "COPY_DIR = " << var("QMAKE_COPY_DIR") << endl;
|
||||
t << "INSTALL_FILE = " << var("QMAKE_INSTALL_FILE") << endl;
|
||||
t << "INSTALL_PROGRAM = " << var("QMAKE_INSTALL_PROGRAM") << endl;
|
||||
t << "INSTALL_DIR = " << var("QMAKE_INSTALL_DIR") << endl;
|
||||
t << "QINSTALL = " << var("QMAKE_QMAKE") << " -install qinstall" << endl;
|
||||
t << "QINSTALL_PROGRAM = " << var("QMAKE_QMAKE") << " -install qinstall -exe" << endl;
|
||||
t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << endl;
|
||||
t << "SYMLINK = " << var("QMAKE_SYMBOLIC_LINK") << endl;
|
||||
t << "DEL_DIR = " << var("QMAKE_DEL_DIR") << endl;
|
||||
t << "MOVE = " << var("QMAKE_MOVE") << endl;
|
||||
t << "QMAKE = " << var("QMAKE_QMAKE") << Qt::endl;
|
||||
t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << Qt::endl;
|
||||
t << "CHK_DIR_EXISTS= " << var("QMAKE_CHK_DIR_EXISTS") << Qt::endl;
|
||||
t << "MKDIR = " << var("QMAKE_MKDIR") << Qt::endl;
|
||||
t << "COPY = " << var("QMAKE_COPY") << Qt::endl;
|
||||
t << "COPY_FILE = " << var("QMAKE_COPY_FILE") << Qt::endl;
|
||||
t << "COPY_DIR = " << var("QMAKE_COPY_DIR") << Qt::endl;
|
||||
t << "INSTALL_FILE = " << var("QMAKE_INSTALL_FILE") << Qt::endl;
|
||||
t << "INSTALL_PROGRAM = " << var("QMAKE_INSTALL_PROGRAM") << Qt::endl;
|
||||
t << "INSTALL_DIR = " << var("QMAKE_INSTALL_DIR") << Qt::endl;
|
||||
t << "QINSTALL = " << var("QMAKE_QMAKE") << " -install qinstall" << Qt::endl;
|
||||
t << "QINSTALL_PROGRAM = " << var("QMAKE_QMAKE") << " -install qinstall -exe" << Qt::endl;
|
||||
t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << Qt::endl;
|
||||
t << "SYMLINK = " << var("QMAKE_SYMBOLIC_LINK") << Qt::endl;
|
||||
t << "DEL_DIR = " << var("QMAKE_DEL_DIR") << Qt::endl;
|
||||
t << "MOVE = " << var("QMAKE_MOVE") << Qt::endl;
|
||||
}
|
||||
|
||||
QString MakefileGenerator::buildArgs(bool withExtra)
|
||||
@ -2349,18 +2336,18 @@ void
|
||||
MakefileGenerator::writeHeader(QTextStream &t)
|
||||
{
|
||||
t << "#############################################################################\n";
|
||||
t << "# Makefile for building: " << escapeFilePath(var("TARGET")) << endl;
|
||||
t << "# Makefile for building: " << escapeFilePath(var("TARGET")) << Qt::endl;
|
||||
t << "# Generated by qmake (" QMAKE_VERSION_STR ") (Qt " QT_VERSION_STR ")\n";
|
||||
t << "# Project: " << fileFixify(project->projectFile()) << endl;
|
||||
t << "# Template: " << var("TEMPLATE") << endl;
|
||||
t << "# Project: " << fileFixify(project->projectFile()) << Qt::endl;
|
||||
t << "# Template: " << var("TEMPLATE") << Qt::endl;
|
||||
if(!project->isActiveConfig("build_pass"))
|
||||
t << "# Command: " << build_args().replace(QLatin1String("$(QMAKE)"), var("QMAKE_QMAKE")) << endl;
|
||||
t << "# Command: " << build_args().replace(QLatin1String("$(QMAKE)"), var("QMAKE_QMAKE")) << Qt::endl;
|
||||
t << "#############################################################################\n";
|
||||
t << endl;
|
||||
t << Qt::endl;
|
||||
QString ofile = Option::fixPathToTargetOS(Option::output.fileName());
|
||||
if (ofile.lastIndexOf(Option::dir_sep) != -1)
|
||||
ofile.remove(0, ofile.lastIndexOf(Option::dir_sep) +1);
|
||||
t << "MAKEFILE = " << escapeFilePath(ofile) << endl << endl;
|
||||
t << "MAKEFILE = " << escapeFilePath(ofile) << Qt::endl << Qt::endl;
|
||||
t << "EQ = =\n\n";
|
||||
}
|
||||
|
||||
@ -2492,7 +2479,7 @@ MakefileGenerator::writeSubDirs(QTextStream &t)
|
||||
void MakefileGenerator::writeSubMakeCall(QTextStream &t, const QString &callPrefix,
|
||||
const QString &makeArguments)
|
||||
{
|
||||
t << callPrefix << "$(MAKE)" << makeArguments << endl;
|
||||
t << callPrefix << "$(MAKE)" << makeArguments << Qt::endl;
|
||||
}
|
||||
|
||||
void
|
||||
@ -2511,20 +2498,30 @@ MakefileGenerator::writeSubTargetCall(QTextStream &t,
|
||||
writeSubMakeCall(t, out_directory_cdin + pfx, makefilein);
|
||||
}
|
||||
|
||||
static void chopEndLines(QString *s)
|
||||
{
|
||||
while (!s->isEmpty()) {
|
||||
const ushort c = s->at(s->size() - 1).unicode();
|
||||
if (c != '\n' && c != '\r')
|
||||
break;
|
||||
s->chop(1);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubTarget*> targets, int flags)
|
||||
{
|
||||
// blasted includes
|
||||
const ProStringList &qeui = project->values("QMAKE_EXTRA_INCLUDES");
|
||||
for (ProStringList::ConstIterator qeui_it = qeui.begin(); qeui_it != qeui.end(); ++qeui_it)
|
||||
t << "include " << (*qeui_it) << endl;
|
||||
t << "include " << (*qeui_it) << Qt::endl;
|
||||
|
||||
if (!(flags & SubTargetSkipDefaultVariables)) {
|
||||
writeDefaultVariables(t);
|
||||
t << "SUBTARGETS = "; // subtargets are sub-directory
|
||||
for(int target = 0; target < targets.size(); ++target)
|
||||
t << " \\\n\t\t" << targets.at(target)->target;
|
||||
t << endl << endl;
|
||||
t << Qt::endl << Qt::endl;
|
||||
}
|
||||
writeExtraVariables(t);
|
||||
|
||||
@ -2536,6 +2533,14 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
|
||||
<< QString((flags & SubTargetInstalls) ? "uninstall_subtargets" : "uninstall");
|
||||
}
|
||||
|
||||
struct SequentialInstallData
|
||||
{
|
||||
QString targetPrefix;
|
||||
QString commands;
|
||||
QTextStream commandsStream;
|
||||
SequentialInstallData() : commandsStream(&commands) {}
|
||||
};
|
||||
std::unique_ptr<SequentialInstallData> sequentialInstallData;
|
||||
bool dont_recurse = project->isActiveConfig("dont_recurse");
|
||||
|
||||
// generate target rules
|
||||
@ -2580,7 +2585,7 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
|
||||
if (!dont_recurse)
|
||||
writeSubMakeCall(t, out_directory_cdin, makefilein + " qmake_all");
|
||||
else
|
||||
t << endl;
|
||||
t << Qt::endl;
|
||||
}
|
||||
|
||||
{ //actually compile
|
||||
@ -2604,6 +2609,16 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
|
||||
else if(s == "make_first")
|
||||
s = QString();
|
||||
|
||||
if (project->isActiveConfig("build_all") && s == "install") {
|
||||
if (!sequentialInstallData)
|
||||
sequentialInstallData.reset(new SequentialInstallData);
|
||||
sequentialInstallData->targetPrefix += subtarget->target + '-';
|
||||
writeSubTargetCall(sequentialInstallData->commandsStream, in_directory, in,
|
||||
out_directory, out, out_directory_cdin,
|
||||
makefilein + " " + s);
|
||||
chopEndLines(&sequentialInstallData->commands);
|
||||
}
|
||||
|
||||
if(flags & SubTargetOrdered) {
|
||||
t << subtarget->target << "-" << targetSuffixes.at(suffix) << "-ordered:";
|
||||
if(target)
|
||||
@ -2621,7 +2636,12 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
|
||||
out_directory_cdin, makefilein + " " + s);
|
||||
}
|
||||
}
|
||||
t << endl;
|
||||
t << Qt::endl;
|
||||
|
||||
if (sequentialInstallData) {
|
||||
t << sequentialInstallData->targetPrefix << "install: FORCE"
|
||||
<< sequentialInstallData->commands << Qt::endl << Qt::endl;
|
||||
}
|
||||
|
||||
if (!(flags & SubTargetSkipDefaultTargets)) {
|
||||
writeMakeQmake(t, true);
|
||||
@ -2670,7 +2690,7 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
|
||||
} else if(suffix == "distclean") {
|
||||
QString ofile = fileFixify(Option::output.fileName());
|
||||
if(!ofile.isEmpty())
|
||||
t << "\t-$(DEL_FILE) " << escapeFilePath(ofile) << endl;
|
||||
t << "\t-$(DEL_FILE) " << escapeFilePath(ofile) << Qt::endl;
|
||||
t << fixFileVarGlue("QMAKE_DISTCLEAN", "\t-$(DEL_FILE) ", " ", "\n");
|
||||
}
|
||||
}
|
||||
@ -2683,7 +2703,7 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
|
||||
cmd = var(ProKey(*qut_it + ".commands")), deps;
|
||||
if(targ.isEmpty())
|
||||
targ = (*qut_it).toQString();
|
||||
t << endl;
|
||||
t << Qt::endl;
|
||||
|
||||
const ProStringList &deplist = project->values(ProKey(*qut_it + ".depends"));
|
||||
for (ProStringList::ConstIterator dep_it = deplist.begin(); dep_it != deplist.end(); ++dep_it) {
|
||||
@ -2696,7 +2716,8 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
|
||||
QSet<QString> recurse;
|
||||
const ProKey rkey(*qut_it + ".recurse");
|
||||
if (project->isSet(rkey)) {
|
||||
recurse = project->values(rkey).toQStringList().toSet();
|
||||
const QStringList values = project->values(rkey).toQStringList();
|
||||
recurse = QSet<QString>(values.begin(), values.end());
|
||||
} else {
|
||||
for(int target = 0; target < targets.size(); ++target)
|
||||
recurse.insert(targets.at(target)->name);
|
||||
@ -2758,7 +2779,7 @@ MakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::SubT
|
||||
deps += " FORCE";
|
||||
t << escapeDependencyPath(Option::fixPathToTargetOS(targ, false)) << ":" << deps << "\n";
|
||||
if(!cmd.isEmpty())
|
||||
t << "\t" << cmd << endl;
|
||||
t << "\t" << cmd << Qt::endl;
|
||||
}
|
||||
|
||||
if(flags & SubTargetInstalls) {
|
||||
@ -2776,7 +2797,7 @@ MakefileGenerator::writeMakeQmake(QTextStream &t, bool noDummyQmakeAll)
|
||||
if(project->isEmpty("QMAKE_FAILED_REQUIREMENTS") && !project->isEmpty("QMAKE_INTERNAL_PRL_FILE")) {
|
||||
QStringList files = escapeFilePaths(fileFixify(Option::mkfile::project_files));
|
||||
t << escapeDependencyPath(project->first("QMAKE_INTERNAL_PRL_FILE").toQString()) << ": \n\t"
|
||||
<< "@$(QMAKE) -prl " << files.join(' ') << ' ' << buildArgs(true) << endl;
|
||||
<< "@$(QMAKE) -prl " << files.join(' ') << ' ' << buildArgs(true) << Qt::endl;
|
||||
}
|
||||
|
||||
QString qmake = build_args();
|
||||
@ -2795,10 +2816,10 @@ MakefileGenerator::writeMakeQmake(QTextStream &t, bool noDummyQmakeAll)
|
||||
}
|
||||
const ProStringList &included = escapeDependencyPaths(project->values("QMAKE_INTERNAL_INCLUDED_FILES"));
|
||||
t << included.join(QString(" \\\n\t\t")) << "\n\t"
|
||||
<< qmake << endl;
|
||||
<< qmake << Qt::endl;
|
||||
const ProStringList &extraCommands = project->values("QMAKE_MAKE_QMAKE_EXTRA_COMMANDS");
|
||||
if (!extraCommands.isEmpty())
|
||||
t << "\t" << extraCommands.join(QString("\n\t")) << endl;
|
||||
t << "\t" << extraCommands.join(QString("\n\t")) << Qt::endl;
|
||||
for(int include = 0; include < included.size(); ++include) {
|
||||
const ProString &i = included.at(include);
|
||||
if(!i.isEmpty())
|
||||
@ -2806,7 +2827,7 @@ MakefileGenerator::writeMakeQmake(QTextStream &t, bool noDummyQmakeAll)
|
||||
}
|
||||
}
|
||||
if(project->first("QMAKE_ORIG_TARGET") != "qmake") {
|
||||
t << "qmake: FORCE\n\t@" << qmake << endl << endl;
|
||||
t << "qmake: FORCE\n\t@" << qmake << Qt::endl << Qt::endl;
|
||||
if (!noDummyQmakeAll)
|
||||
t << "qmake_all: FORCE\n\n";
|
||||
}
|
||||
@ -3298,11 +3319,11 @@ MakefileGenerator::writePkgConfigFile()
|
||||
if(includeDir.isEmpty())
|
||||
includeDir = prefix + "/include";
|
||||
|
||||
t << "prefix=" << prefix << endl;
|
||||
t << "prefix=" << prefix << Qt::endl;
|
||||
t << "exec_prefix=${prefix}\n"
|
||||
<< "libdir=" << pkgConfigFixPath(libDir) << "\n"
|
||||
<< "includedir=" << pkgConfigFixPath(includeDir) << endl;
|
||||
t << endl;
|
||||
<< "includedir=" << pkgConfigFixPath(includeDir) << Qt::endl;
|
||||
t << Qt::endl;
|
||||
|
||||
//extra PKGCONFIG variables
|
||||
const ProStringList &pkgconfig_vars = project->values("QMAKE_PKGCONFIG_VARIABLES");
|
||||
@ -3323,17 +3344,17 @@ MakefileGenerator::writePkgConfigFile()
|
||||
}
|
||||
}
|
||||
if (!val.isEmpty())
|
||||
t << var << "=" << val << endl;
|
||||
t << var << "=" << val << Qt::endl;
|
||||
}
|
||||
|
||||
t << endl;
|
||||
t << Qt::endl;
|
||||
|
||||
QString name = project->first("QMAKE_PKGCONFIG_NAME").toQString();
|
||||
if(name.isEmpty()) {
|
||||
name = project->first("QMAKE_ORIG_TARGET").toQString().toLower();
|
||||
name.replace(0, 1, name[0].toUpper());
|
||||
}
|
||||
t << "Name: " << name << endl;
|
||||
t << "Name: " << name << Qt::endl;
|
||||
QString desc = project->values("QMAKE_PKGCONFIG_DESCRIPTION").join(' ');
|
||||
if(desc.isEmpty()) {
|
||||
if(name.isEmpty()) {
|
||||
@ -3351,12 +3372,12 @@ MakefileGenerator::writePkgConfigFile()
|
||||
desc += " Application";
|
||||
}
|
||||
}
|
||||
t << "Description: " << desc << endl;
|
||||
t << "Description: " << desc << Qt::endl;
|
||||
ProString version = project->first("QMAKE_PKGCONFIG_VERSION");
|
||||
if (version.isEmpty())
|
||||
version = project->first("VERSION");
|
||||
if (!version.isEmpty())
|
||||
t << "Version: " << version << endl;
|
||||
t << "Version: " << version << Qt::endl;
|
||||
|
||||
// libs
|
||||
t << "Libs: ";
|
||||
@ -3393,7 +3414,7 @@ MakefileGenerator::writePkgConfigFile()
|
||||
t << "Libs.private:";
|
||||
for (ProStringList::ConstIterator it = libs.cbegin(); it != libs.cend(); ++it)
|
||||
t << ' ' << fixLibFlags((*it).toKey()).join(' ');
|
||||
t << endl;
|
||||
t << Qt::endl;
|
||||
}
|
||||
|
||||
// flags
|
||||
@ -3411,15 +3432,15 @@ MakefileGenerator::writePkgConfigFile()
|
||||
&& libDir != QLatin1String("/Library/Frameworks")) {
|
||||
t << " -F${libdir}";
|
||||
}
|
||||
t << endl;
|
||||
t << Qt::endl;
|
||||
|
||||
// requires
|
||||
const QString requires = project->values("QMAKE_PKGCONFIG_REQUIRES").join(' ');
|
||||
if (!requires.isEmpty()) {
|
||||
t << "Requires: " << requires << endl;
|
||||
t << "Requires: " << requires << Qt::endl;
|
||||
}
|
||||
|
||||
t << endl;
|
||||
t << Qt::endl;
|
||||
}
|
||||
|
||||
static QString windowsifyPath(const QString &str)
|
||||
|
@ -54,7 +54,7 @@ struct ReplaceExtraCompilerCacheKey;
|
||||
class MakefileGenerator : protected QMakeSourceFileInfo
|
||||
{
|
||||
QString spec;
|
||||
bool no_io;
|
||||
bool no_io = false;
|
||||
bool resolveDependenciesInFrameworks = false;
|
||||
QHash<QString, bool> init_compiler_already;
|
||||
QString makedir, chkexists;
|
||||
@ -131,7 +131,7 @@ protected:
|
||||
QMakeLocalFileName fixPathForFile(const QMakeLocalFileName &, bool) override;
|
||||
QMakeLocalFileName findFileForDep(const QMakeLocalFileName &, const QMakeLocalFileName &) override;
|
||||
QFileInfo findFileInfo(const QMakeLocalFileName &) override;
|
||||
QMakeProject *project;
|
||||
QMakeProject *project = nullptr;
|
||||
|
||||
//escape
|
||||
virtual QString escapeFilePath(const QString &path) const = 0;
|
||||
@ -256,8 +256,6 @@ protected:
|
||||
const QString &fixedFile);
|
||||
|
||||
public:
|
||||
MakefileGenerator();
|
||||
~MakefileGenerator();
|
||||
QMakeProject *projectFile() const;
|
||||
void setProjectFile(QMakeProject *p);
|
||||
|
||||
@ -295,9 +293,6 @@ inline QString MakefileGenerator::installRoot() const
|
||||
inline bool MakefileGenerator::findLibraries(bool, bool)
|
||||
{ return true; }
|
||||
|
||||
inline MakefileGenerator::~MakefileGenerator()
|
||||
{ }
|
||||
|
||||
struct ReplaceExtraCompilerCacheKey
|
||||
{
|
||||
mutable uint hash;
|
||||
|
@ -837,7 +837,9 @@ bool QMakeSourceFileInfo::findDeps(SourceFile *file)
|
||||
if(inc) {
|
||||
if(!includes)
|
||||
includes = new SourceFiles;
|
||||
SourceFile *dep = includes->lookupFile(inc);
|
||||
/* QTBUG-72383: Local includes "foo.h" must first be resolved relative to the
|
||||
* sourceDir, only global includes <bar.h> are unique. */
|
||||
SourceFile *dep = try_local ? nullptr : includes->lookupFile(inc);
|
||||
if(!dep) {
|
||||
bool exists = false;
|
||||
QMakeLocalFileName lfn(inc);
|
||||
@ -876,7 +878,11 @@ bool QMakeSourceFileInfo::findDeps(SourceFile *file)
|
||||
dep->file = lfn;
|
||||
dep->type = QMakeSourceFileInfo::TYPE_C;
|
||||
files->addFile(dep);
|
||||
includes->addFile(dep, inc, false);
|
||||
/* QTBUG-72383: Local includes "foo.h" are keyed by the resolved
|
||||
* path (stored in dep itself), only global includes <bar.h> are
|
||||
* unique keys immediately. */
|
||||
const char *key = try_local ? nullptr : inc;
|
||||
includes->addFile(dep, key, false);
|
||||
}
|
||||
dep->exists = exists;
|
||||
}
|
||||
|
@ -27,7 +27,6 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include "metamakefile.h"
|
||||
#include "qregexp.h"
|
||||
#include "qdir.h"
|
||||
#include "qdebug.h"
|
||||
#include "makefile.h"
|
||||
|
@ -50,10 +50,6 @@ QString project_builtin_regx() //calculate the builtin regular expression..
|
||||
return ret;
|
||||
}
|
||||
|
||||
ProjectGenerator::ProjectGenerator() : MakefileGenerator()
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
ProjectGenerator::init()
|
||||
{
|
||||
@ -324,14 +320,14 @@ ProjectGenerator::init()
|
||||
bool
|
||||
ProjectGenerator::writeMakefile(QTextStream &t)
|
||||
{
|
||||
t << "######################################################################" << endl;
|
||||
t << "# Automatically generated by qmake (" QMAKE_VERSION_STR ") " << QDateTime::currentDateTime().toString() << endl;
|
||||
t << "######################################################################" << endl << endl;
|
||||
t << "######################################################################" << Qt::endl;
|
||||
t << "# Automatically generated by qmake (" QMAKE_VERSION_STR ") " << QDateTime::currentDateTime().toString() << Qt::endl;
|
||||
t << "######################################################################" << Qt::endl << Qt::endl;
|
||||
if (!Option::globals->extra_cmds[QMakeEvalBefore].isEmpty())
|
||||
t << Option::globals->extra_cmds[QMakeEvalBefore] << endl;
|
||||
t << Option::globals->extra_cmds[QMakeEvalBefore] << Qt::endl;
|
||||
t << getWritableVar("TEMPLATE_ASSIGN", false);
|
||||
if(project->first("TEMPLATE_ASSIGN") == "subdirs") {
|
||||
t << endl << "# Directories" << "\n"
|
||||
t << Qt::endl << "# Directories" << "\n"
|
||||
<< getWritableVar("SUBDIRS");
|
||||
} else {
|
||||
//figure out target
|
||||
@ -343,7 +339,7 @@ ProjectGenerator::writeMakefile(QTextStream &t)
|
||||
t << getWritableVar("TARGET_ASSIGN")
|
||||
<< getWritableVar("CONFIG", false)
|
||||
<< getWritableVar("CONFIG_REMOVE", false)
|
||||
<< getWritableVar("INCLUDEPATH") << endl;
|
||||
<< getWritableVar("INCLUDEPATH") << Qt::endl;
|
||||
|
||||
t << "# You can make your code fail to compile if you use deprecated APIs.\n"
|
||||
"# In order to do so, uncomment the following line.\n"
|
||||
@ -362,7 +358,7 @@ ProjectGenerator::writeMakefile(QTextStream &t)
|
||||
<< getWritableVar("TRANSLATIONS");
|
||||
}
|
||||
if (!Option::globals->extra_cmds[QMakeEvalAfter].isEmpty())
|
||||
t << Option::globals->extra_cmds[QMakeEvalAfter] << endl;
|
||||
t << Option::globals->extra_cmds[QMakeEvalAfter] << Qt::endl;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -46,15 +46,10 @@ protected:
|
||||
QString escapeFilePath(const QString &path) const override { Q_ASSERT(false); return QString(); }
|
||||
|
||||
public:
|
||||
ProjectGenerator();
|
||||
~ProjectGenerator();
|
||||
bool supportsMetaBuild() override { return false; }
|
||||
bool openOutput(QFile &, const QString &) const override;
|
||||
};
|
||||
|
||||
inline ProjectGenerator::~ProjectGenerator()
|
||||
{ }
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // PROJECTGENERATOR_H
|
||||
|
@ -28,7 +28,6 @@
|
||||
|
||||
#include "unixmake.h"
|
||||
#include "option.h"
|
||||
#include <qregexp.h>
|
||||
#include <qfile.h>
|
||||
#include <qhash.h>
|
||||
#include <qdir.h>
|
||||
|
@ -35,15 +35,11 @@ QT_BEGIN_NAMESPACE
|
||||
|
||||
class UnixMakefileGenerator : public MakefileGenerator
|
||||
{
|
||||
bool include_deps;
|
||||
bool include_deps = false;
|
||||
QString libtoolFileName(bool fixify=true);
|
||||
void writeLibtoolFile(); // for libtool
|
||||
void writePrlFile(QTextStream &) override;
|
||||
|
||||
public:
|
||||
UnixMakefileGenerator();
|
||||
~UnixMakefileGenerator();
|
||||
|
||||
protected:
|
||||
virtual bool doPrecompiledHeaders() const { return project->isActiveConfig("precompile_header"); }
|
||||
bool doDepends() const override { return !Option::mkfile::do_stub_makefile && MakefileGenerator::doDepends(); }
|
||||
@ -69,9 +65,6 @@ private:
|
||||
ProStringList libdirToFlags(const ProKey &key);
|
||||
};
|
||||
|
||||
inline UnixMakefileGenerator::~UnixMakefileGenerator()
|
||||
{ }
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // UNIXMAKE_H
|
||||
|
@ -39,11 +39,6 @@
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
UnixMakefileGenerator::UnixMakefileGenerator() : MakefileGenerator(), include_deps(false)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
UnixMakefileGenerator::writePrlFile(QTextStream &t)
|
||||
{
|
||||
@ -83,8 +78,8 @@ void
|
||||
UnixMakefileGenerator::writeDefaultVariables(QTextStream &t)
|
||||
{
|
||||
MakefileGenerator::writeDefaultVariables(t);
|
||||
t << "TAR = " << var("QMAKE_TAR") << endl;
|
||||
t << "COMPRESS = " << var("QMAKE_GZIP") << endl;
|
||||
t << "TAR = " << var("QMAKE_TAR") << Qt::endl;
|
||||
t << "COMPRESS = " << var("QMAKE_GZIP") << Qt::endl;
|
||||
|
||||
if (project->isEmpty("QMAKE_DISTNAME")) {
|
||||
ProString distname = project->first("QMAKE_ORIG_TARGET");
|
||||
@ -92,13 +87,13 @@ UnixMakefileGenerator::writeDefaultVariables(QTextStream &t)
|
||||
distname += project->first("VERSION");
|
||||
project->values("QMAKE_DISTNAME") = distname;
|
||||
}
|
||||
t << "DISTNAME = " << fileVar("QMAKE_DISTNAME") << endl;
|
||||
t << "DISTNAME = " << fileVar("QMAKE_DISTNAME") << Qt::endl;
|
||||
|
||||
if (project->isEmpty("QMAKE_DISTDIR"))
|
||||
project->values("QMAKE_DISTDIR") = project->first("QMAKE_DISTNAME");
|
||||
t << "DISTDIR = " << escapeFilePath(fileFixify(
|
||||
(project->isEmpty("OBJECTS_DIR") ? ProString(".tmp/") : project->first("OBJECTS_DIR")) + project->first("QMAKE_DISTDIR"),
|
||||
FileFixifyFromOutdir | FileFixifyAbsolute)) << endl;
|
||||
FileFixifyFromOutdir | FileFixifyAbsolute)) << Qt::endl;
|
||||
}
|
||||
|
||||
void
|
||||
@ -106,10 +101,10 @@ UnixMakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::
|
||||
{
|
||||
MakefileGenerator::writeSubTargets(t, targets, flags);
|
||||
|
||||
t << "dist: distdir FORCE" << endl;
|
||||
t << "dist: distdir FORCE" << Qt::endl;
|
||||
t << "\t(cd `dirname $(DISTDIR)` && $(TAR) $(DISTNAME).tar $(DISTNAME) && $(COMPRESS) $(DISTNAME).tar)"
|
||||
" && $(MOVE) `dirname $(DISTDIR)`/$(DISTNAME).tar.gz . && $(DEL_FILE) -r $(DISTDIR)";
|
||||
t << endl << endl;
|
||||
t << Qt::endl << Qt::endl;
|
||||
|
||||
t << "distdir:";
|
||||
for (int target = 0; target < targets.size(); ++target) {
|
||||
@ -118,7 +113,7 @@ UnixMakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::
|
||||
}
|
||||
t << " FORCE\n\t"
|
||||
<< mkdir_p_asstring("$(DISTDIR)", false) << "\n\t"
|
||||
<< "$(COPY_FILE) --parents " << fileVar("DISTFILES") << " $(DISTDIR)" << Option::dir_sep << endl << endl;
|
||||
<< "$(COPY_FILE) --parents " << fileVar("DISTFILES") << " $(DISTDIR)" << Option::dir_sep << Qt::endl << Qt::endl;
|
||||
|
||||
const QString abs_source_path = project->first("QMAKE_ABSOLUTE_SOURCE_PATH").toQString();
|
||||
for (int target = 0; target < targets.size(); ++target) {
|
||||
@ -151,7 +146,7 @@ UnixMakefileGenerator::writeSubTargets(QTextStream &t, QList<MakefileGenerator::
|
||||
t << subtarget->target << "-distdir: FORCE";
|
||||
writeSubTargetCall(t, in_directory, in, out_directory, escapeFilePath(out),
|
||||
out_directory_cdin, makefilein);
|
||||
t << endl;
|
||||
t << Qt::endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -183,11 +178,11 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
||||
writeExportedVariables(t);
|
||||
|
||||
t << "####### Compiler, tools and options\n\n";
|
||||
t << "CC = " << var("QMAKE_CC") << endl;
|
||||
t << "CXX = " << var("QMAKE_CXX") << endl;
|
||||
t << "CC = " << var("QMAKE_CC") << Qt::endl;
|
||||
t << "CXX = " << var("QMAKE_CXX") << Qt::endl;
|
||||
t << "DEFINES = "
|
||||
<< varGlue("PRL_EXPORT_DEFINES","-D"," -D"," ")
|
||||
<< varGlue("DEFINES","-D"," -D","") << endl;
|
||||
<< varGlue("DEFINES","-D"," -D","") << Qt::endl;
|
||||
t << "CFLAGS = " << var("QMAKE_CFLAGS") << " $(DEFINES)\n";
|
||||
t << "CXXFLAGS = " << var("QMAKE_CXXFLAGS") << " $(DEFINES)\n";
|
||||
t << "INCPATH =";
|
||||
@ -208,38 +203,38 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
||||
}
|
||||
if(!project->isEmpty("QMAKE_FRAMEWORKPATH_FLAGS"))
|
||||
t << " " << var("QMAKE_FRAMEWORKPATH_FLAGS");
|
||||
t << endl;
|
||||
t << Qt::endl;
|
||||
|
||||
writeDefaultVariables(t);
|
||||
|
||||
if(!project->isActiveConfig("staticlib")) {
|
||||
t << "LINK = " << var("QMAKE_LINK") << endl;
|
||||
t << "LFLAGS = " << var("QMAKE_LFLAGS") << endl;
|
||||
t << "LINK = " << var("QMAKE_LINK") << Qt::endl;
|
||||
t << "LFLAGS = " << var("QMAKE_LFLAGS") << Qt::endl;
|
||||
t << "LIBS = $(SUBLIBS) " << fixLibFlags("LIBS").join(' ') << ' '
|
||||
<< fixLibFlags("LIBS_PRIVATE").join(' ') << ' '
|
||||
<< fixLibFlags("QMAKE_LIBS").join(' ') << ' '
|
||||
<< fixLibFlags("QMAKE_LIBS_PRIVATE").join(' ') << endl;
|
||||
<< fixLibFlags("QMAKE_LIBS_PRIVATE").join(' ') << Qt::endl;
|
||||
}
|
||||
|
||||
t << "AR = " << var("QMAKE_AR") << endl;
|
||||
t << "RANLIB = " << var("QMAKE_RANLIB") << endl;
|
||||
t << "SED = " << var("QMAKE_STREAM_EDITOR") << endl;
|
||||
t << "STRIP = " << var("QMAKE_STRIP") << endl;
|
||||
t << "AR = " << var("QMAKE_AR") << Qt::endl;
|
||||
t << "RANLIB = " << var("QMAKE_RANLIB") << Qt::endl;
|
||||
t << "SED = " << var("QMAKE_STREAM_EDITOR") << Qt::endl;
|
||||
t << "STRIP = " << var("QMAKE_STRIP") << Qt::endl;
|
||||
|
||||
t << endl;
|
||||
t << Qt::endl;
|
||||
|
||||
t << "####### Output directory\n\n";
|
||||
// This is used in commands by some .prf files.
|
||||
if (! project->values("OBJECTS_DIR").isEmpty())
|
||||
t << "OBJECTS_DIR = " << fileVar("OBJECTS_DIR") << endl;
|
||||
t << "OBJECTS_DIR = " << fileVar("OBJECTS_DIR") << Qt::endl;
|
||||
else
|
||||
t << "OBJECTS_DIR = ./\n";
|
||||
t << endl;
|
||||
t << Qt::endl;
|
||||
|
||||
/* files */
|
||||
t << "####### Files\n\n";
|
||||
// This is used by the dist target.
|
||||
t << "SOURCES = " << fileVarList("SOURCES") << ' ' << fileVarList("GENERATED_SOURCES") << endl;
|
||||
t << "SOURCES = " << fileVarList("SOURCES") << ' ' << fileVarList("GENERATED_SOURCES") << Qt::endl;
|
||||
if(do_incremental) {
|
||||
const ProStringList &objs = project->values("OBJECTS");
|
||||
const ProStringList &incrs = project->values("QMAKE_INCREMENTAL");
|
||||
@ -259,59 +254,59 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
||||
t << "\\\n\t\t" << (*objit);
|
||||
}
|
||||
if(incrs_out.count() == objs.count()) { //we just switched places, no real incrementals to be done!
|
||||
t << escapeFilePaths(incrs_out).join(QString(" \\\n\t\t")) << endl;
|
||||
t << escapeFilePaths(incrs_out).join(QString(" \\\n\t\t")) << Qt::endl;
|
||||
} else if(!incrs_out.count()) {
|
||||
t << endl;
|
||||
t << Qt::endl;
|
||||
} else {
|
||||
src_incremental = true;
|
||||
t << endl;
|
||||
t << Qt::endl;
|
||||
t << "INCREMENTAL_OBJECTS = "
|
||||
<< escapeFilePaths(incrs_out).join(QString(" \\\n\t\t")) << endl;
|
||||
<< escapeFilePaths(incrs_out).join(QString(" \\\n\t\t")) << Qt::endl;
|
||||
}
|
||||
} else {
|
||||
// Used all over the place in both deps and commands.
|
||||
t << "OBJECTS = " << valList(escapeDependencyPaths(project->values("OBJECTS"))) << endl;
|
||||
t << "OBJECTS = " << valList(escapeDependencyPaths(project->values("OBJECTS"))) << Qt::endl;
|
||||
}
|
||||
if(do_incremental && !src_incremental)
|
||||
do_incremental = false;
|
||||
t << "DIST = " << valList(fileFixify(project->values("DISTFILES").toQStringList())) << " "
|
||||
<< fileVarList("HEADERS") << ' ' << fileVarList("SOURCES") << endl;
|
||||
t << "QMAKE_TARGET = " << fileVar("QMAKE_ORIG_TARGET") << endl;
|
||||
<< fileVarList("HEADERS") << ' ' << fileVarList("SOURCES") << Qt::endl;
|
||||
t << "QMAKE_TARGET = " << fileVar("QMAKE_ORIG_TARGET") << Qt::endl;
|
||||
QString destd = fileVar("DESTDIR");
|
||||
// When building on non-MSys MinGW, the path ends with a backslash, which
|
||||
// GNU make will interpret that as a line continuation. Doubling the backslash
|
||||
// avoids the problem, at the cost of the variable containing *both* backslashes.
|
||||
if (destd.endsWith('\\'))
|
||||
destd += '\\';
|
||||
t << "DESTDIR = " << destd << endl;
|
||||
t << "TARGET = " << fileVar("TARGET") << endl;
|
||||
t << "DESTDIR = " << destd << Qt::endl;
|
||||
t << "TARGET = " << fileVar("TARGET") << Qt::endl;
|
||||
if(project->isActiveConfig("plugin")) {
|
||||
t << "TARGETD = " << fileVar("TARGET") << endl;
|
||||
t << "TARGETD = " << fileVar("TARGET") << Qt::endl;
|
||||
} else if(!project->isActiveConfig("staticlib") && project->values("QMAKE_APP_FLAG").isEmpty()) {
|
||||
t << "TARGETA = " << fileVar("TARGETA") << endl;
|
||||
t << "TARGETA = " << fileVar("TARGETA") << Qt::endl;
|
||||
if(!project->isEmpty("QMAKE_BUNDLE")) {
|
||||
t << "TARGETD = " << fileVar("TARGET_x.y") << endl;
|
||||
t << "TARGET0 = " << fileVar("TARGET_") << endl;
|
||||
t << "TARGETD = " << fileVar("TARGET_x.y") << Qt::endl;
|
||||
t << "TARGET0 = " << fileVar("TARGET_") << Qt::endl;
|
||||
} else if (!project->isActiveConfig("unversioned_libname")) {
|
||||
t << "TARGET0 = " << fileVar("TARGET_") << endl;
|
||||
t << "TARGET0 = " << fileVar("TARGET_") << Qt::endl;
|
||||
if (project->isEmpty("QMAKE_HPUX_SHLIB")) {
|
||||
t << "TARGETD = " << fileVar("TARGET_x.y.z") << endl;
|
||||
t << "TARGET1 = " << fileVar("TARGET_x") << endl;
|
||||
t << "TARGET2 = " << fileVar("TARGET_x.y") << endl;
|
||||
t << "TARGETD = " << fileVar("TARGET_x.y.z") << Qt::endl;
|
||||
t << "TARGET1 = " << fileVar("TARGET_x") << Qt::endl;
|
||||
t << "TARGET2 = " << fileVar("TARGET_x.y") << Qt::endl;
|
||||
} else {
|
||||
t << "TARGETD = " << fileVar("TARGET_x") << endl;
|
||||
t << "TARGETD = " << fileVar("TARGET_x") << Qt::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
writeExtraCompilerVariables(t);
|
||||
writeExtraVariables(t);
|
||||
t << endl;
|
||||
t << Qt::endl;
|
||||
|
||||
// blasted includes
|
||||
const ProStringList &qeui = project->values("QMAKE_EXTRA_INCLUDES");
|
||||
ProStringList::ConstIterator it;
|
||||
for(it = qeui.begin(); it != qeui.end(); ++it)
|
||||
t << "include " << escapeDependencyPath(*it) << endl;
|
||||
t << "include " << escapeDependencyPath(*it) << Qt::endl;
|
||||
|
||||
/* rules */
|
||||
t << "first:" << (!project->isActiveConfig("no_default_goal_deps") ? " all" : "") << "\n";
|
||||
@ -321,7 +316,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
||||
ProStringList objects = project->values("OBJECTS");
|
||||
for (ProStringList::Iterator it = objects.begin(); it != objects.end(); ++it) {
|
||||
QString d_file = (*it).toQString().replace(QRegExp(Option::obj_ext + "$"), ".d");
|
||||
t << "-include " << escapeDependencyPath(d_file) << endl;
|
||||
t << "-include " << escapeDependencyPath(d_file) << Qt::endl;
|
||||
project->values("QMAKE_DISTCLEAN") << d_file;
|
||||
}
|
||||
} else {
|
||||
@ -379,8 +374,8 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
||||
QStringList deps = findDependencies((*it).toQString()).filter(QRegExp(
|
||||
"((^|/)" + Option::h_moc_mod + "|" + Option::cpp_moc_ext + "$)"));
|
||||
if(!deps.isEmpty())
|
||||
t << d_file_d << ": " << finalizeDependencyPaths(deps).join(' ') << endl;
|
||||
t << "-include " << d_file_d << endl;
|
||||
t << d_file_d << ": " << finalizeDependencyPaths(deps).join(' ') << Qt::endl;
|
||||
t << "-include " << d_file_d << Qt::endl;
|
||||
project->values("QMAKE_DISTCLEAN") += d_file;
|
||||
}
|
||||
}
|
||||
@ -399,7 +394,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
||||
for (ProStringList::ConstIterator it = l.begin(); it != l.end(); ++it)
|
||||
t << escapeFilePath(libdir + project->first("QMAKE_PREFIX_STATICLIB") + (*it) + '.'
|
||||
+ project->first("QMAKE_EXTENSION_STATICLIB")) << ' ';
|
||||
t << endl << endl;
|
||||
t << Qt::endl << Qt::endl;
|
||||
}
|
||||
QString target_deps;
|
||||
if ((project->isActiveConfig("depend_prl") || project->isActiveConfig("fast_depend_prl"))
|
||||
@ -504,7 +499,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
||||
t << "$(LINK) $(LFLAGS) " << var("QMAKE_LINK_O_FLAG") << "$(TARGET) " << incr_deps << " " << incr_objs << " $(OBJCOMP) $(LIBS)";
|
||||
if(!project->isEmpty("QMAKE_POST_LINK"))
|
||||
t << "\n\t" << var("QMAKE_POST_LINK");
|
||||
t << endl << endl;
|
||||
t << Qt::endl << Qt::endl;
|
||||
} else {
|
||||
t << depVar("TARGET") << ": " << depVar("PRE_TARGETDEPS") << " $(OBJECTS) "
|
||||
<< target_deps << ' ' << depVar("POST_TARGETDEPS") << "\n\t";
|
||||
@ -517,7 +512,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
||||
if (!project->isEmpty("QMAKE_POST_LINK"))
|
||||
t << "\n\t" << var("QMAKE_POST_LINK");
|
||||
}
|
||||
t << endl << endl;
|
||||
t << Qt::endl << Qt::endl;
|
||||
}
|
||||
allDeps = ' ' + depVar("TARGET");
|
||||
} else if(!project->isActiveConfig("staticlib")) {
|
||||
@ -548,7 +543,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
||||
//actual target
|
||||
const QString link_deps = "$(OBJECTS) ";
|
||||
t << incr_target_dir_d << ": " << link_deps << "\n\t"
|
||||
<< "ld -r -o " << incr_target_dir_f << ' ' << link_deps << endl;
|
||||
<< "ld -r -o " << incr_target_dir_f << ' ' << link_deps << Qt::endl;
|
||||
//communicated below
|
||||
ProStringList &cmd = project->values("QMAKE_LINK_SHLIB_CMD");
|
||||
cmd[0] = cmd.at(0).toQString().replace(QLatin1String("$(OBJECTS) "), QLatin1String("$(INCREMENTAL_OBJECTS)")); //ick
|
||||
@ -606,7 +601,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
||||
<< "-$(MOVE) $(TARGET) " << destdir << "$(TARGET)";
|
||||
if(!project->isEmpty("QMAKE_POST_LINK"))
|
||||
t << "\n\t" << var("QMAKE_POST_LINK");
|
||||
t << endl << endl;
|
||||
t << Qt::endl << Qt::endl;
|
||||
} else if(!project->isEmpty("QMAKE_BUNDLE")) {
|
||||
bundledFiles << destdir_r + var("TARGET");
|
||||
t << "\n\t"
|
||||
@ -620,7 +615,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
||||
" Versions/Current/$(TARGET) $(DESTDIR)$(TARGET0)") << "\n\t";
|
||||
if(!project->isEmpty("QMAKE_POST_LINK"))
|
||||
t << "\n\t" << var("QMAKE_POST_LINK");
|
||||
t << endl << endl;
|
||||
t << Qt::endl << Qt::endl;
|
||||
} else if(project->isEmpty("QMAKE_HPUX_SHLIB")) {
|
||||
t << "\n\t";
|
||||
|
||||
@ -654,7 +649,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
||||
}
|
||||
if(!project->isEmpty("QMAKE_POST_LINK"))
|
||||
t << "\n\t" << var("QMAKE_POST_LINK");
|
||||
t << endl << endl;
|
||||
t << Qt::endl << Qt::endl;
|
||||
} else {
|
||||
t << "\n\t"
|
||||
<< "-$(DEL_FILE) $(TARGET) $(TARGET0)\n\t"
|
||||
@ -668,9 +663,9 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
||||
<< "-$(MOVE) $(TARGET0) " << destdir << "$(TARGET0)\n\t";
|
||||
if(!project->isEmpty("QMAKE_POST_LINK"))
|
||||
t << "\n\t" << var("QMAKE_POST_LINK");
|
||||
t << endl << endl;
|
||||
t << Qt::endl << Qt::endl;
|
||||
}
|
||||
t << endl << endl;
|
||||
t << Qt::endl << Qt::endl;
|
||||
|
||||
if (! project->isActiveConfig("plugin")) {
|
||||
t << "staticlib: " << depVar("TARGETA") << "\n\n";
|
||||
@ -688,7 +683,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
||||
t << "\n\t" << var("QMAKE_POST_LINK");
|
||||
if(!project->isEmpty("QMAKE_RANLIB"))
|
||||
t << "\n\t$(RANLIB) $(TARGETA)";
|
||||
t << endl << endl;
|
||||
t << Qt::endl << Qt::endl;
|
||||
}
|
||||
} else {
|
||||
QString destdir_r = project->first("DESTDIR").toQString();
|
||||
@ -708,7 +703,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
||||
t << "\t" << var("QMAKE_POST_LINK") << "\n";
|
||||
if (!project->isEmpty("QMAKE_RANLIB"))
|
||||
t << "\t$(RANLIB) " << destdir << "$(TARGET)\n";
|
||||
t << endl << endl;
|
||||
t << Qt::endl << Qt::endl;
|
||||
}
|
||||
|
||||
writeMakeQmake(t);
|
||||
@ -722,7 +717,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
||||
}
|
||||
if(!meta_files.isEmpty())
|
||||
t << escapeDependencyPaths(meta_files).join(" ") << ": \n\t"
|
||||
<< "@$(QMAKE) -prl " << escapeFilePath(project->projectFile()) << ' ' << buildArgs(true) << endl;
|
||||
<< "@$(QMAKE) -prl " << escapeFilePath(project->projectFile()) << ' ' << buildArgs(true) << Qt::endl;
|
||||
}
|
||||
|
||||
if (!project->isEmpty("QMAKE_BUNDLE")) {
|
||||
@ -743,7 +738,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
||||
<< "@echo \"APPL"
|
||||
<< (project->isEmpty("QMAKE_PKGINFO_TYPEINFO")
|
||||
? QString::fromLatin1("????") : project->first("QMAKE_PKGINFO_TYPEINFO").left(4))
|
||||
<< "\" > " << pkginfo_f << endl;
|
||||
<< "\" > " << pkginfo_f << Qt::endl;
|
||||
}
|
||||
if (!project->first("QMAKE_BUNDLE_RESOURCE_FILE").isEmpty()) {
|
||||
ProString resources = project->first("QMAKE_BUNDLE_RESOURCE_FILE");
|
||||
@ -852,7 +847,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
||||
<< "-e \"s,\\$${EXECUTABLE_NAME}," << (app_bundle_name.isEmpty() ? app_bundle_name : plugin_bundle_name) << ",g\" "
|
||||
<< "-e \"s,@TYPEINFO@,"<< typeInfo << ",g\" "
|
||||
<< "-e \"s,\\$${QMAKE_PKGINFO_TYPEINFO},"<< typeInfo << ",g\" "
|
||||
<< "" << info_plist << " >" << info_plist_out << endl;
|
||||
<< "" << info_plist << " >" << info_plist_out << Qt::endl;
|
||||
//copy the icon
|
||||
if (!project->isEmpty("ICON")) {
|
||||
QString dir = bundle_dir + "Contents/Resources/";
|
||||
@ -863,7 +858,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
||||
t << escapeDependencyPath(icon_path) << ": " << escapeDependencyPath(icon) << "\n\t"
|
||||
<< mkdir_p_asstring(dir) << "\n\t"
|
||||
<< "@$(DEL_FILE) " << icon_path_f << "\n\t"
|
||||
<< "@$(COPY_FILE) " << escapeFilePath(icon) << ' ' << icon_path_f << endl;
|
||||
<< "@$(COPY_FILE) " << escapeFilePath(icon) << ' ' << icon_path_f << Qt::endl;
|
||||
}
|
||||
} else {
|
||||
ProString lib_bundle_name = var("QMAKE_FRAMEWORK_BUNDLE_NAME");
|
||||
@ -880,7 +875,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
||||
<< "-e \"s,\\$${EXECUTABLE_NAME}," << lib_bundle_name << ",g\" "
|
||||
<< "-e \"s,@TYPEINFO@," << typeInfo << ",g\" "
|
||||
<< "-e \"s,\\$${QMAKE_PKGINFO_TYPEINFO}," << typeInfo << ",g\" "
|
||||
<< "" << info_plist << " >" << info_plist_out << endl;
|
||||
<< "" << info_plist << " >" << info_plist_out << Qt::endl;
|
||||
}
|
||||
break;
|
||||
} // project->isActiveConfig("no_plist")
|
||||
@ -924,10 +919,10 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
||||
QFileInfo fi(fileInfo(fn));
|
||||
if(fi.isDir())
|
||||
t << "@$(DEL_FILE) -r " << dst << "\n\t"
|
||||
<< "@$(COPY_DIR) " << src << " " << dst << endl;
|
||||
<< "@$(COPY_DIR) " << src << " " << dst << Qt::endl;
|
||||
else
|
||||
t << "@$(DEL_FILE) " << dst << "\n\t"
|
||||
<< "@$(COPY_FILE) " << src << " " << dst << endl;
|
||||
<< "@$(COPY_FILE) " << src << " " << dst << Qt::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -940,7 +935,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
||||
alldeps << symIt.key();
|
||||
t << escapeDependencyPath(symIt.key()) << ":\n\t"
|
||||
<< mkdir_p_asstring(bundle_dir) << "\n\t"
|
||||
<< "@$(SYMLINK) " << escapeFilePath(symIt.value()) << ' ' << bundle_dir_f << endl;
|
||||
<< "@$(SYMLINK) " << escapeFilePath(symIt.value()) << ' ' << bundle_dir_f << Qt::endl;
|
||||
}
|
||||
|
||||
if (!project->isActiveConfig("shallow_bundle")) {
|
||||
@ -952,24 +947,24 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
||||
<< mkdir_p_asstring(bundle_dir + "Versions") << "\n\t"
|
||||
<< "@-$(DEL_FILE) " << currentLink_f << "\n\t"
|
||||
<< "@$(SYMLINK) " << project->first("QMAKE_FRAMEWORK_VERSION")
|
||||
<< ' ' << currentLink_f << endl;
|
||||
<< ' ' << currentLink_f << Qt::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
t << endl << "all: " << deps
|
||||
t << Qt::endl << "all: " << deps
|
||||
<< valGlue(escapeDependencyPaths(project->values("ALL_DEPS")), " \\\n\t\t", " \\\n\t\t", "")
|
||||
<< allDeps << endl << endl;
|
||||
<< allDeps << Qt::endl << Qt::endl;
|
||||
|
||||
t << "dist: distdir FORCE\n\t";
|
||||
t << "(cd `dirname $(DISTDIR)` && $(TAR) $(DISTNAME).tar $(DISTNAME) && $(COMPRESS) $(DISTNAME).tar)"
|
||||
" && $(MOVE) `dirname $(DISTDIR)`" << Option::dir_sep << "$(DISTNAME).tar.gz ."
|
||||
" && $(DEL_FILE) -r $(DISTDIR)";
|
||||
t << endl << endl;
|
||||
t << Qt::endl << Qt::endl;
|
||||
|
||||
t << "distdir: FORCE\n\t"
|
||||
<< mkdir_p_asstring("$(DISTDIR)", false) << "\n\t"
|
||||
<< "$(COPY_FILE) --parents $(DIST) $(DISTDIR)" << Option::dir_sep << endl;
|
||||
<< "$(COPY_FILE) --parents $(DIST) $(DISTDIR)" << Option::dir_sep << Qt::endl;
|
||||
if(!project->isEmpty("QMAKE_EXTRA_COMPILERS")) {
|
||||
const ProStringList &quc = project->values("QMAKE_EXTRA_COMPILERS");
|
||||
for (ProStringList::ConstIterator it = quc.begin(); it != quc.end(); ++it) {
|
||||
@ -979,20 +974,20 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
||||
if(val.isEmpty())
|
||||
continue;
|
||||
t << "\t$(COPY_FILE) --parents " << escapeFilePaths(val).join(' ')
|
||||
<< " $(DISTDIR)" << Option::dir_sep << endl;
|
||||
<< " $(DISTDIR)" << Option::dir_sep << Qt::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(!project->isEmpty("TRANSLATIONS"))
|
||||
t << "\t$(COPY_FILE) --parents " << fileVar("TRANSLATIONS") << " $(DISTDIR)" << Option::dir_sep << endl;
|
||||
t << endl << endl;
|
||||
t << "\t$(COPY_FILE) --parents " << fileVar("TRANSLATIONS") << " $(DISTDIR)" << Option::dir_sep << Qt::endl;
|
||||
t << Qt::endl << Qt::endl;
|
||||
|
||||
QString clean_targets = " compiler_clean " + depVar("CLEAN_DEPS");
|
||||
if(do_incremental) {
|
||||
t << "incrclean:\n";
|
||||
if(src_incremental)
|
||||
t << "\t-$(DEL_FILE) $(INCREMENTAL_OBJECTS)\n";
|
||||
t << endl;
|
||||
t << Qt::endl;
|
||||
}
|
||||
|
||||
t << "clean:" << clean_targets << "\n\t";
|
||||
@ -1060,7 +1055,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
||||
t << "-$(DEL_FILE) $(INCREMENTAL_OBJECTS)\n\t";
|
||||
t << fileVarGlue("QMAKE_CLEAN","-$(DEL_FILE) "," ","\n\t")
|
||||
<< "-$(DEL_FILE) *~ core *.core\n"
|
||||
<< fileVarGlue("CLEAN_FILES","\t-$(DEL_FILE) "," ","") << endl << endl;
|
||||
<< fileVarGlue("CLEAN_FILES","\t-$(DEL_FILE) "," ","") << Qt::endl << Qt::endl;
|
||||
|
||||
ProString destdir = project->first("DESTDIR");
|
||||
if (!destdir.isEmpty() && !destdir.endsWith(Option::dir_sep))
|
||||
@ -1068,7 +1063,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
||||
t << "distclean: clean " << depVar("DISTCLEAN_DEPS") << '\n';
|
||||
if(!project->isEmpty("QMAKE_BUNDLE")) {
|
||||
QString bundlePath = escapeFilePath(destdir + project->first("QMAKE_BUNDLE"));
|
||||
t << "\t-$(DEL_FILE) -r " << bundlePath << endl;
|
||||
t << "\t-$(DEL_FILE) -r " << bundlePath << Qt::endl;
|
||||
} else if (project->isActiveConfig("staticlib") || project->isActiveConfig("plugin")) {
|
||||
t << "\t-$(DEL_FILE) " << escapeFilePath(destdir) << "$(TARGET) \n";
|
||||
} else if (project->values("QMAKE_APP_FLAG").isEmpty()) {
|
||||
@ -1087,9 +1082,9 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
||||
{
|
||||
QString ofile = fileFixify(Option::output.fileName());
|
||||
if(!ofile.isEmpty())
|
||||
t << "\t-$(DEL_FILE) " << escapeFilePath(ofile) << endl;
|
||||
t << "\t-$(DEL_FILE) " << escapeFilePath(ofile) << Qt::endl;
|
||||
}
|
||||
t << endl << endl;
|
||||
t << Qt::endl << Qt::endl;
|
||||
|
||||
t << "####### Sub-libraries\n\n";
|
||||
if (!project->values("SUBLIBS").isEmpty()) {
|
||||
@ -1100,7 +1095,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
||||
for (it = l.begin(); it != l.end(); ++it)
|
||||
t << escapeDependencyPath(libdir + project->first("QMAKE_PREFIX_STATICLIB") + (*it) + '.'
|
||||
+ project->first("QMAKE_EXTENSION_STATICLIB")) << ":\n\t"
|
||||
<< var(ProKey("MAKELIB" + *it)) << endl << endl;
|
||||
<< var(ProKey("MAKELIB" + *it)) << Qt::endl << Qt::endl;
|
||||
}
|
||||
|
||||
if(doPrecompiledHeaders() && !project->isEmpty("PRECOMPILED_HEADER")) {
|
||||
@ -1184,7 +1179,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
||||
compilerExecutable = "$(CXX)";
|
||||
|
||||
// compile command
|
||||
t << "\n\t" << compilerExecutable << cflags << " $(INCPATH) " << pchArchFlags << endl << endl;
|
||||
t << "\n\t" << compilerExecutable << cflags << " $(INCPATH) " << pchArchFlags << Qt::endl << Qt::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -38,10 +38,6 @@
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
MingwMakefileGenerator::MingwMakefileGenerator() : Win32MakefileGenerator()
|
||||
{
|
||||
}
|
||||
|
||||
QString MingwMakefileGenerator::escapeDependencyPath(const QString &path) const
|
||||
{
|
||||
QString ret = path;
|
||||
@ -99,7 +95,7 @@ bool MingwMakefileGenerator::writeMakefile(QTextStream &t)
|
||||
writePkgConfigFile();
|
||||
|
||||
if(Option::mkfile::do_stub_makefile) {
|
||||
t << "QMAKE = " << var("QMAKE_QMAKE") << endl;
|
||||
t << "QMAKE = " << var("QMAKE_QMAKE") << Qt::endl;
|
||||
const ProStringList &qut = project->values("QMAKE_EXTRA_TARGETS");
|
||||
for (ProStringList::ConstIterator it = qut.begin(); it != qut.end(); ++it)
|
||||
t << escapeDependencyPath(*it) << ' ';
|
||||
@ -148,7 +144,7 @@ void createLdResponseFile(const QString &fileName, const ProStringList &objList)
|
||||
.replace(QLatin1Char('\t'), QLatin1String("\\\t"))
|
||||
.replace(QLatin1Char('"'), QLatin1String("\\\""))
|
||||
.replace(QLatin1Char('\''), QLatin1String("\\'"));
|
||||
t << path << endl;
|
||||
t << path << Qt::endl;
|
||||
}
|
||||
t.flush();
|
||||
file.close();
|
||||
@ -162,9 +158,9 @@ void createArObjectScriptFile(const QString &fileName, const QString &target, co
|
||||
if (file.open(QIODevice::WriteOnly | QIODevice::Text)) {
|
||||
QTextStream t(&file);
|
||||
// ### quoting?
|
||||
t << "CREATE " << target << endl;
|
||||
t << "CREATE " << target << Qt::endl;
|
||||
for (ProStringList::ConstIterator it = objList.constBegin(); it != objList.constEnd(); ++it) {
|
||||
t << "ADDMOD " << *it << endl;
|
||||
t << "ADDMOD " << *it << Qt::endl;
|
||||
}
|
||||
t << "SAVE\n";
|
||||
t.flush();
|
||||
@ -183,13 +179,13 @@ void MingwMakefileGenerator::writeMingwParts(QTextStream &t)
|
||||
<< finalizeDependencyPaths(findDependencies(header)).join(" \\\n\t\t")
|
||||
<< "\n\t" << mkdir_p_asstring(preCompHeaderOut)
|
||||
<< "\n\t$(CC) -x c-header -c $(CFLAGS) $(INCPATH) -o " << escapeFilePath(cHeader)
|
||||
<< ' ' << escapeFilePath(header) << endl << endl;
|
||||
<< ' ' << escapeFilePath(header) << Qt::endl << Qt::endl;
|
||||
QString cppHeader = preCompHeaderOut + Option::dir_sep + "c++";
|
||||
t << escapeDependencyPath(cppHeader) << ": " << escapeDependencyPath(header) << " "
|
||||
<< finalizeDependencyPaths(findDependencies(header)).join(" \\\n\t\t")
|
||||
<< "\n\t" << mkdir_p_asstring(preCompHeaderOut)
|
||||
<< "\n\t$(CXX) -x c++-header -c $(CXXFLAGS) $(INCPATH) -o " << escapeFilePath(cppHeader)
|
||||
<< ' ' << escapeFilePath(header) << endl << endl;
|
||||
<< ' ' << escapeFilePath(header) << Qt::endl << Qt::endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -274,21 +270,21 @@ void MingwMakefileGenerator::writeIncPart(QTextStream &t)
|
||||
t << "-I";
|
||||
t << escapeFilePath(inc) << ' ';
|
||||
}
|
||||
t << endl;
|
||||
t << Qt::endl;
|
||||
}
|
||||
|
||||
void MingwMakefileGenerator::writeLibsPart(QTextStream &t)
|
||||
{
|
||||
if(project->isActiveConfig("staticlib") && project->first("TEMPLATE") == "lib") {
|
||||
t << "LIB = " << var("QMAKE_LIB") << endl;
|
||||
t << "LIB = " << var("QMAKE_LIB") << Qt::endl;
|
||||
} else {
|
||||
t << "LINKER = " << var("QMAKE_LINK") << endl;
|
||||
t << "LFLAGS = " << var("QMAKE_LFLAGS") << endl;
|
||||
t << "LINKER = " << var("QMAKE_LINK") << Qt::endl;
|
||||
t << "LFLAGS = " << var("QMAKE_LFLAGS") << Qt::endl;
|
||||
t << "LIBS = "
|
||||
<< fixLibFlags("LIBS").join(' ') << ' '
|
||||
<< fixLibFlags("LIBS_PRIVATE").join(' ') << ' '
|
||||
<< fixLibFlags("QMAKE_LIBS").join(' ') << ' '
|
||||
<< fixLibFlags("QMAKE_LIBS_PRIVATE").join(' ') << endl;
|
||||
<< fixLibFlags("QMAKE_LIBS_PRIVATE").join(' ') << Qt::endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -350,7 +346,7 @@ void MingwMakefileGenerator::writeBuildRulesPart(QTextStream &t)
|
||||
}
|
||||
if(!project->isEmpty("QMAKE_POST_LINK"))
|
||||
t << "\n\t" <<var("QMAKE_POST_LINK");
|
||||
t << endl;
|
||||
t << Qt::endl;
|
||||
}
|
||||
|
||||
void MingwMakefileGenerator::writeRcFilePart(QTextStream &t)
|
||||
|
@ -35,9 +35,6 @@ QT_BEGIN_NAMESPACE
|
||||
|
||||
class MingwMakefileGenerator : public Win32MakefileGenerator
|
||||
{
|
||||
public:
|
||||
MingwMakefileGenerator();
|
||||
~MingwMakefileGenerator();
|
||||
protected:
|
||||
using MakefileGenerator::escapeDependencyPath;
|
||||
QString escapeDependencyPath(const QString &path) const override;
|
||||
@ -65,9 +62,6 @@ private:
|
||||
QString objectsLinkLine;
|
||||
};
|
||||
|
||||
inline MingwMakefileGenerator::~MingwMakefileGenerator()
|
||||
{ }
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // MINGW_MAKE_H
|
||||
|
@ -34,6 +34,7 @@
|
||||
#include <qscopedpointer.h>
|
||||
#include <qstringlist.h>
|
||||
#include <qfileinfo.h>
|
||||
#include <qregexp.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
@ -142,6 +143,7 @@ const char _InterfaceIdentifierFileName[] = "InterfaceIdentifierFileName";
|
||||
const char _IntermediateDirectory[] = "IntermediateDirectory";
|
||||
const char _KeyContainer[] = "KeyContainer";
|
||||
const char _KeyFile[] = "KeyFile";
|
||||
const char _LanguageStandard[] = "LanguageStandard";
|
||||
const char _LargeAddressAware[] = "LargeAddressAware";
|
||||
const char _LinkDLL[] = "LinkDLL";
|
||||
const char _LinkErrorReporting[] = "LinkErrorReporting";
|
||||
@ -1477,6 +1479,7 @@ void VCXProjectWriter::write(XmlOutput &xml, const VCCLCompilerTool &tool)
|
||||
<< attrTagT(_IntrinsicFunctions, tool.EnableIntrinsicFunctions)
|
||||
<< attrTagT(_MinimalRebuild, tool.MinimalRebuild)
|
||||
<< attrTagT(_MultiProcessorCompilation, tool.MultiProcessorCompilation)
|
||||
<< attrTagS(_LanguageStandard, tool.LanguageStandard)
|
||||
<< attrTagS(_ObjectFileName, tool.ObjectFile)
|
||||
<< attrTagT(_OmitDefaultLibName, tool.OmitDefaultLibName)
|
||||
<< attrTagT(_OmitFramePointers, tool.OmitFramePointers)
|
||||
|