Examples: Fix CMake Unity (Jumbo) builds
Disambiguate variables and add some exclusions. Task-number: QTBUG-109394 Change-Id: Ie72b3caab9fd571c3fb6f7d8606584885bc09e66 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io> (cherry picked from commit 93af309a707ea2ab133e281d837ac37b1351fb47) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
6cde2907d2
commit
b9ed727556
@ -19,7 +19,7 @@
|
|||||||
static CborConverter cborConverter;
|
static CborConverter cborConverter;
|
||||||
static CborDiagnosticDumper cborDiagnosticDumper;
|
static CborDiagnosticDumper cborDiagnosticDumper;
|
||||||
|
|
||||||
static const char optionHelp[] =
|
static const char cborOptionHelp[] =
|
||||||
"convert-float-to-int=yes|no Write integers instead of floating point, if no\n"
|
"convert-float-to-int=yes|no Write integers instead of floating point, if no\n"
|
||||||
" loss of precision occurs on conversion.\n"
|
" loss of precision occurs on conversion.\n"
|
||||||
"float16=yes|always|no Write using half-precision floating point.\n"
|
"float16=yes|always|no Write using half-precision floating point.\n"
|
||||||
@ -207,7 +207,7 @@ Converter::Options CborConverter::outputOptions()
|
|||||||
|
|
||||||
const char *CborConverter::optionsHelp()
|
const char *CborConverter::optionsHelp()
|
||||||
{
|
{
|
||||||
return optionHelp;
|
return cborOptionHelp;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CborConverter::probeFile(QIODevice *f)
|
bool CborConverter::probeFile(QIODevice *f)
|
||||||
@ -314,7 +314,7 @@ void CborConverter::saveFile(QIODevice *f, const QVariant &contents, const QStri
|
|||||||
}
|
}
|
||||||
|
|
||||||
fprintf(stderr, "Unknown CBOR format option '%s'. Valid options are:\n%s",
|
fprintf(stderr, "Unknown CBOR format option '%s'. Valid options are:\n%s",
|
||||||
qPrintable(s), optionHelp);
|
qPrintable(s), cborOptionHelp);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
//! [4]
|
//! [4]
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
|
|
||||||
static const char optionHelp[] =
|
static const char dataStreamOptionHelp[] =
|
||||||
"byteorder=host|big|little Byte order to use.\n"
|
"byteorder=host|big|little Byte order to use.\n"
|
||||||
"version=<n> QDataStream version (default: Qt 5.0).\n"
|
"version=<n> QDataStream version (default: Qt 5.0).\n"
|
||||||
;
|
;
|
||||||
@ -143,7 +143,7 @@ Converter::Options DataStreamConverter::outputOptions()
|
|||||||
|
|
||||||
const char *DataStreamConverter::optionsHelp()
|
const char *DataStreamConverter::optionsHelp()
|
||||||
{
|
{
|
||||||
return optionHelp;
|
return dataStreamOptionHelp;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DataStreamConverter::probeFile(QIODevice *f)
|
bool DataStreamConverter::probeFile(QIODevice *f)
|
||||||
@ -209,7 +209,7 @@ void DataStreamConverter::saveFile(QIODevice *f, const QVariant &contents, const
|
|||||||
}
|
}
|
||||||
|
|
||||||
fprintf(stderr, "Unknown QDataStream formatting option '%s'. Available options are:\n%s",
|
fprintf(stderr, "Unknown QDataStream formatting option '%s'. Available options are:\n%s",
|
||||||
qPrintable(option), optionHelp);
|
qPrintable(option), dataStreamOptionHelp);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
static JsonConverter jsonConverter;
|
static JsonConverter jsonConverter;
|
||||||
|
|
||||||
static const char optionHelp[] =
|
static const char jsonOptionHelp[] =
|
||||||
"compact=no|yes Use compact JSON form.\n";
|
"compact=no|yes Use compact JSON form.\n";
|
||||||
|
|
||||||
static QJsonDocument convertFromVariant(const QVariant &v)
|
static QJsonDocument convertFromVariant(const QVariant &v)
|
||||||
@ -45,7 +45,7 @@ Converter::Options JsonConverter::outputOptions()
|
|||||||
|
|
||||||
const char *JsonConverter::optionsHelp()
|
const char *JsonConverter::optionsHelp()
|
||||||
{
|
{
|
||||||
return optionHelp;
|
return jsonOptionHelp;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool JsonConverter::probeFile(QIODevice *f)
|
bool JsonConverter::probeFile(QIODevice *f)
|
||||||
@ -96,7 +96,8 @@ void JsonConverter::saveFile(QIODevice *f, const QVariant &contents, const QStri
|
|||||||
} else if (s == QLatin1String("compact=yes")) {
|
} else if (s == QLatin1String("compact=yes")) {
|
||||||
format = QJsonDocument::Compact;
|
format = QJsonDocument::Compact;
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr, "Unknown option '%s' to JSON output. Valid options are:\n%s", qPrintable(s), optionHelp);
|
fprintf(stderr, "Unknown option '%s' to JSON output. Valid options are:\n%s",
|
||||||
|
qPrintable(s), jsonOptionHelp);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
#include <QXmlStreamReader>
|
#include <QXmlStreamReader>
|
||||||
#include <QXmlStreamWriter>
|
#include <QXmlStreamWriter>
|
||||||
|
|
||||||
static const char optionHelp[] =
|
static const char xmlOptionHelp[] =
|
||||||
"compact=no|yes Use compact XML form.\n";
|
"compact=no|yes Use compact XML form.\n";
|
||||||
|
|
||||||
static XmlConverter xmlConverter;
|
static XmlConverter xmlConverter;
|
||||||
@ -416,7 +416,7 @@ Converter::Options XmlConverter::outputOptions()
|
|||||||
|
|
||||||
const char *XmlConverter::optionsHelp()
|
const char *XmlConverter::optionsHelp()
|
||||||
{
|
{
|
||||||
return optionHelp;
|
return xmlOptionHelp;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool XmlConverter::probeFile(QIODevice *f)
|
bool XmlConverter::probeFile(QIODevice *f)
|
||||||
@ -454,7 +454,8 @@ void XmlConverter::saveFile(QIODevice *f, const QVariant &contents, const QStrin
|
|||||||
} else if (s == QLatin1String("compact=yes")) {
|
} else if (s == QLatin1String("compact=yes")) {
|
||||||
compact = true;
|
compact = true;
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr, "Unknown option '%s' to XML output. Valid options are:\n%s", qPrintable(s), optionHelp);
|
fprintf(stderr, "Unknown option '%s' to XML output. Valid options are:\n%s",
|
||||||
|
qPrintable(s), xmlOptionHelp);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@ static const int PendingRequestTimeout = 60 * 1000;
|
|||||||
static const int ClientTimeout = 120 * 1000;
|
static const int ClientTimeout = 120 * 1000;
|
||||||
static const int ConnectTimeout = 60 * 1000;
|
static const int ConnectTimeout = 60 * 1000;
|
||||||
static const int KeepAliveInterval = 30 * 1000;
|
static const int KeepAliveInterval = 30 * 1000;
|
||||||
static const int RateControlTimerDelay = 2000;
|
static const int PeerRateControlTimerDelay = 2000;
|
||||||
static const int MinimalHeaderSize = 48;
|
static const int MinimalHeaderSize = 48;
|
||||||
static const char ProtocolId[] = "BitTorrent protocol";
|
static const char ProtocolId[] = "BitTorrent protocol";
|
||||||
static const char ProtocolIdSize = 19;
|
static const char ProtocolIdSize = 19;
|
||||||
@ -45,7 +45,7 @@ PeerWireClient::PeerWireClient(const QByteArray &peerId, QObject *parent)
|
|||||||
memset(uploadSpeedData, 0, sizeof(uploadSpeedData));
|
memset(uploadSpeedData, 0, sizeof(uploadSpeedData));
|
||||||
memset(downloadSpeedData, 0, sizeof(downloadSpeedData));
|
memset(downloadSpeedData, 0, sizeof(downloadSpeedData));
|
||||||
|
|
||||||
transferSpeedTimer = startTimer(RateControlTimerDelay);
|
transferSpeedTimer = startTimer(PeerRateControlTimerDelay);
|
||||||
timeoutTimer = startTimer(ConnectTimeout);
|
timeoutTimer = startTimer(ConnectTimeout);
|
||||||
peerIdString = peerId;
|
peerIdString = peerId;
|
||||||
|
|
||||||
|
@ -11,6 +11,8 @@ target_sources(painting_shared PRIVATE
|
|||||||
${moc_files}
|
${moc_files}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
set_target_properties(painting_shared PROPERTIES UNITY_BUILD OFF)
|
||||||
|
|
||||||
target_link_libraries(painting_shared PUBLIC Qt6::Widgets)
|
target_link_libraries(painting_shared PUBLIC Qt6::Widgets)
|
||||||
target_include_directories(painting_shared PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
|
target_include_directories(painting_shared PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user