aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2017-10-06 17:30:36 +0200
committerUlf Hermann <ulf.hermann@qt.io>2017-11-08 13:18:25 +0000
commit4e6d5951ed853b236b03ad46ac14649449830d96 (patch)
tree8ee83435fe83ce38ae0d250b8bb0722f45fad63a
parent7bedd55551fbe95355b0db11f9d576924e829f9d (diff)
Make qml-debug a proper feature
Change-Id: Iea33ff0200f0bbf43953fedba030edf91d0f1417 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
-rw-r--r--src/plugins/plugins.pro3
-rw-r--r--src/qml/compiler/qv4instr_moth_p.h2
-rw-r--r--src/qml/compiler/qv4isel_moth.cpp4
-rw-r--r--src/qml/compiler/qv4jsir_p.h4
-rw-r--r--src/qml/configure.json13
-rw-r--r--src/qml/debugger/debugger.pri13
-rw-r--r--src/qml/debugger/qqmlabstractprofileradapter_p.h4
-rw-r--r--src/qml/debugger/qqmldebug.cpp2
-rw-r--r--src/qml/debugger/qqmldebug.h2
-rw-r--r--src/qml/debugger/qqmldebugconnector_p.h4
-rw-r--r--src/qml/debugger/qqmldebugpluginmanager_p.h6
-rw-r--r--src/qml/debugger/qqmldebugservice_p.h6
-rw-r--r--src/qml/debugger/qqmldebugserviceinterfaces_p.h6
-rw-r--r--src/qml/debugger/qqmldebugstatesdelegate_p.h2
-rw-r--r--src/qml/debugger/qqmlmemoryprofiler_p.h2
-rw-r--r--src/qml/debugger/qqmlprofiler_p.h6
-rw-r--r--src/qml/debugger/qqmlprofilerdefinitions_p.h6
-rw-r--r--src/qml/jsruntime/jsruntime.pri2
-rw-r--r--src/qml/jsruntime/qv4debugging_p.h2
-rw-r--r--src/qml/jsruntime/qv4engine.cpp4
-rw-r--r--src/qml/jsruntime/qv4engine_p.h6
-rw-r--r--src/qml/jsruntime/qv4profiling_p.h4
-rw-r--r--src/qml/jsruntime/qv4vme_moth.cpp8
-rw-r--r--src/qml/qml/qqmlengine.cpp4
-rw-r--r--src/qml/qml/qqmlengine_p.h2
-rw-r--r--src/qml/qml/qqmltypeloader.cpp2
-rw-r--r--src/qml/qml/qqmltypeloader_p.h6
-rw-r--r--src/qml/qtqmlglobal.h2
-rw-r--r--src/qmltest/qmltest.pro2
-rw-r--r--src/quick/qtquick2.cpp4
-rw-r--r--src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp1
-rw-r--r--src/quick/util/qquickprofiler_p.h9
-rw-r--r--src/quick/util/util.pri2
-rw-r--r--src/src.pro5
-rw-r--r--tests/auto/qml/qml.pro3
-rw-r--r--tools/qml/qml.pro2
-rw-r--r--tools/qmlscene/qmlscene.pro2
37 files changed, 87 insertions, 70 deletions
diff --git a/src/plugins/plugins.pro b/src/plugins/plugins.pro
index 2467239be2..0afd71767e 100644
--- a/src/plugins/plugins.pro
+++ b/src/plugins/plugins.pro
@@ -1,4 +1,5 @@
TEMPLATE = subdirs
+QT_FOR_CONFIG += qml
-!contains(QT_CONFIG, no-qml-debug):SUBDIRS += qmltooling
+qtConfig(qml-debug):SUBDIRS += qmltooling
qtHaveModule(quick):SUBDIRS += scenegraph
diff --git a/src/qml/compiler/qv4instr_moth_p.h b/src/qml/compiler/qv4instr_moth_p.h
index 5f46e90ec7..1bdb8df414 100644
--- a/src/qml/compiler/qv4instr_moth_p.h
+++ b/src/qml/compiler/qv4instr_moth_p.h
@@ -60,7 +60,7 @@ QT_REQUIRE_CONFIG(qml_interpreter);
QT_BEGIN_NAMESPACE
-#ifdef QT_NO_QML_DEBUGGER
+#if !QT_CONFIG(qml_debug)
#define MOTH_DEBUG_INSTR(F)
#else
#define MOTH_DEBUG_INSTR(F) \
diff --git a/src/qml/compiler/qv4isel_moth.cpp b/src/qml/compiler/qv4isel_moth.cpp
index 82f5225f28..d25d1733c8 100644
--- a/src/qml/compiler/qv4isel_moth.cpp
+++ b/src/qml/compiler/qv4isel_moth.cpp
@@ -256,7 +256,7 @@ void InstructionSelection::run(int functionIndex)
if (s->location.startLine != currentLine) {
blockNeedsDebugInstruction = false;
currentLine = s->location.startLine;
-#ifndef QT_NO_QML_DEBUGGER
+#if QT_CONFIG(qml_debug)
if (irModule->debugMode) {
Instruction::Debug debug;
debug.lineNumber = currentLine;
@@ -943,7 +943,7 @@ void InstructionSelection::prepareCallArgs(IR::ExprList *e, quint32 &argc, quint
void InstructionSelection::addDebugInstruction()
{
-#ifndef QT_NO_QML_DEBUGGER
+#if QT_CONFIG(qml_debug)
if (blockNeedsDebugInstruction) {
Instruction::Debug debug;
debug.lineNumber = -int(currentLine);
diff --git a/src/qml/compiler/qv4jsir_p.h b/src/qml/compiler/qv4jsir_p.h
index fb65eb4d8c..7bdad31260 100644
--- a/src/qml/compiler/qv4jsir_p.h
+++ b/src/qml/compiler/qv4jsir_p.h
@@ -956,7 +956,7 @@ struct Q_QML_PRIVATE_EXPORT Module {
bool isQmlModule; // implies rootFunction is always 0
uint unitFlags; // flags merged into CompiledData::Unit::flags
QString targetABI; // fallback to QSysInfo::buildAbi() if empty
-#ifdef QT_NO_QML_DEBUGGER
+#if !QT_CONFIG(qml_debug)
static const bool debugMode = false;
#else
bool debugMode;
@@ -968,7 +968,7 @@ struct Q_QML_PRIVATE_EXPORT Module {
: rootFunction(0)
, isQmlModule(false)
, unitFlags(0)
-#ifndef QT_NO_QML_DEBUGGER
+#if QT_CONFIG(qml_debug)
, debugMode(debugMode)
{}
#else
diff --git a/src/qml/configure.json b/src/qml/configure.json
index 7c0a33bc71..a589e9f950 100644
--- a/src/qml/configure.json
+++ b/src/qml/configure.json
@@ -8,7 +8,8 @@
"commandline": {
"options": {
"qml-interpreter": "boolean",
- "qml-network": "boolean"
+ "qml-network": "boolean",
+ "qml-debug": "boolean"
}
},
@@ -25,6 +26,12 @@
"section": "QML",
"output": [ "publicFeature" ]
},
+ "qml-debug": {
+ "label": "QML debugging and profiling support",
+ "purpose": "Provides infrastructure and plugins for debugging and profiling.",
+ "section": "QML",
+ "output": [ "publicFeature" ]
+ },
"qml-profiler": {
"label": "Command line QML Profiler",
"purpose": "Supports retrieving QML tracing data from an application.",
@@ -33,6 +40,7 @@
"features.commandlineparser",
"features.localserver",
"features.process",
+ "features.qml-debug",
"features.qml-network",
"features.xmlstreamwriter"
],
@@ -45,7 +53,8 @@
"section": "Qt QML",
"entries": [
"qml-interpreter",
- "qml-network"
+ "qml-network",
+ "qml-debug"
]
}
]
diff --git a/src/qml/debugger/debugger.pri b/src/qml/debugger/debugger.pri
index b8d2347b17..202a46e550 100644
--- a/src/qml/debugger/debugger.pri
+++ b/src/qml/debugger/debugger.pri
@@ -1,13 +1,13 @@
-contains(QT_CONFIG, no-qml-debug) {
- DEFINES += QT_NO_QML_DEBUGGER
- MODULE_DEFINES += QT_NO_QML_DEBUGGER
-} else {
+qtConfig(qml-debug) {
HEADERS += \
+ $$PWD/qqmlabstractprofileradapter_p.h \
$$PWD/qqmlconfigurabledebugservice_p.h \
$$PWD/qqmldebugpluginmanager_p.h \
+ $$PWD/qqmldebugservice_p.h \
$$PWD/qqmldebugservicefactory_p.h \
$$PWD/qqmldebugserver_p.h \
- $$PWD/qqmldebugserverconnection_p.h
+ $$PWD/qqmldebugserverconnection_p.h \
+ $$PWD/qqmlprofilerdefinitions_p.h
SOURCES += \
$$PWD/qqmldebug.cpp \
@@ -21,13 +21,10 @@ contains(QT_CONFIG, no-qml-debug) {
HEADERS += \
$$PWD/qqmldebugconnector_p.h \
- $$PWD/qqmldebugservice_p.h \
$$PWD/qqmldebugserviceinterfaces_p.h \
$$PWD/qqmldebugstatesdelegate_p.h \
$$PWD/qqmldebug.h \
$$PWD/qqmlmemoryprofiler_p.h \
- $$PWD/qqmlprofilerdefinitions_p.h \
- $$PWD/qqmlabstractprofileradapter_p.h \
$$PWD/qqmlprofiler_p.h
INCLUDEPATH += $$PWD
diff --git a/src/qml/debugger/qqmlabstractprofileradapter_p.h b/src/qml/debugger/qqmlabstractprofileradapter_p.h
index 6a05a80f37..5d1b339324 100644
--- a/src/qml/debugger/qqmlabstractprofileradapter_p.h
+++ b/src/qml/debugger/qqmlabstractprofileradapter_p.h
@@ -59,7 +59,7 @@
QT_BEGIN_NAMESPACE
-#ifndef QT_NO_QML_DEBUGGER
+QT_REQUIRE_CONFIG(qml_debug);
class QQmlProfilerService;
class Q_QML_PRIVATE_EXPORT QQmlAbstractProfilerAdapter : public QObject, public QQmlProfilerDefinitions {
@@ -116,8 +116,6 @@ public:
#define QQmlAbstractProfilerAdapterFactory_iid "org.qt-project.Qt.QQmlAbstractProfilerAdapterFactory"
-#endif // QT_NO_QML_DEBUGGER
-
QT_END_NAMESPACE
#endif // QQMLABSTRACTPROFILERADAPTER_P_H
diff --git a/src/qml/debugger/qqmldebug.cpp b/src/qml/debugger/qqmldebug.cpp
index 681dc06215..6246fb4207 100644
--- a/src/qml/debugger/qqmldebug.cpp
+++ b/src/qml/debugger/qqmldebug.cpp
@@ -44,6 +44,8 @@
#include <private/qqmlengine_p.h>
#include <private/qv4compileddata_p.h>
+QT_REQUIRE_CONFIG(qml_debug);
+
QT_BEGIN_NAMESPACE
QQmlDebuggingEnabler::QQmlDebuggingEnabler(bool printWarning)
diff --git a/src/qml/debugger/qqmldebug.h b/src/qml/debugger/qqmldebug.h
index 6a0cfdc709..d0ceb28cdc 100644
--- a/src/qml/debugger/qqmldebug.h
+++ b/src/qml/debugger/qqmldebug.h
@@ -46,7 +46,7 @@
QT_BEGIN_NAMESPACE
-#ifndef QT_NO_QML_DEBUGGER
+#if QT_CONFIG(qml_debug)
struct Q_QML_EXPORT QQmlDebuggingEnabler
{
diff --git a/src/qml/debugger/qqmldebugconnector_p.h b/src/qml/debugger/qqmldebugconnector_p.h
index 0d3e2e2e47..a2a6f5047d 100644
--- a/src/qml/debugger/qqmldebugconnector_p.h
+++ b/src/qml/debugger/qqmldebugconnector_p.h
@@ -44,7 +44,9 @@
#include <QtQml/qjsengine.h>
#include <QtCore/QVariantList>
+#if QT_CONFIG(qml_debug)
#include <private/qqmldebugservice_p.h>
+#endif
//
// W A R N I N G
@@ -59,7 +61,7 @@
QT_BEGIN_NAMESPACE
-#ifdef QT_NO_QML_DEBUGGER
+#if !QT_CONFIG(qml_debug)
class Q_QML_PRIVATE_EXPORT QQmlDebugConnector
{
diff --git a/src/qml/debugger/qqmldebugpluginmanager_p.h b/src/qml/debugger/qqmldebugpluginmanager_p.h
index 8f52b65b17..2575cbb96a 100644
--- a/src/qml/debugger/qqmldebugpluginmanager_p.h
+++ b/src/qml/debugger/qqmldebugpluginmanager_p.h
@@ -57,7 +57,7 @@
QT_BEGIN_NAMESPACE
-#if defined(QT_NO_QML_DEBUGGER)
+#if !QT_CONFIG(qml_debug)
#define Q_QML_DEBUG_PLUGIN_LOADER(interfaceName)\
interfaceName *load##interfaceName(const QString &key)\
@@ -72,7 +72,7 @@ QT_BEGIN_NAMESPACE
}
#define Q_QML_IMPORT_DEBUG_PLUGIN(className)
-#else // QT_NO_QML_DEBUGGER
+#else // QT_CONFIG(qml_debug)
#define Q_QML_DEBUG_PLUGIN_LOADER(interfaceName)\
Q_GLOBAL_STATIC_WITH_ARGS(QFactoryLoader, interfaceName##Loader,\
@@ -86,7 +86,7 @@ QT_BEGIN_NAMESPACE
return interfaceName##Loader()->metaData();\
}
-#endif // QT_NO_QML_DEBUGGER
+#endif // QT_CONFIG(qml_debug)
QT_END_NAMESPACE
#endif // QQMLDEBUGPLUGINMANAGER_P_H
diff --git a/src/qml/debugger/qqmldebugservice_p.h b/src/qml/debugger/qqmldebugservice_p.h
index 42a57a39f2..34bbd631ec 100644
--- a/src/qml/debugger/qqmldebugservice_p.h
+++ b/src/qml/debugger/qqmldebugservice_p.h
@@ -56,9 +56,9 @@
// We mean it.
//
-QT_BEGIN_NAMESPACE
+QT_REQUIRE_CONFIG(qml_debug);
-#ifndef QT_NO_QML_DEBUGGER
+QT_BEGIN_NAMESPACE
class QJSEngine;
@@ -103,8 +103,6 @@ signals:
void messagesToClient(const QString &name, const QList<QByteArray> &messages);
};
-#endif
-
QT_END_NAMESPACE
#endif // QQMLDEBUGSERVICE_H
diff --git a/src/qml/debugger/qqmldebugserviceinterfaces_p.h b/src/qml/debugger/qqmldebugserviceinterfaces_p.h
index 12965ff383..01693aee24 100644
--- a/src/qml/debugger/qqmldebugserviceinterfaces_p.h
+++ b/src/qml/debugger/qqmldebugserviceinterfaces_p.h
@@ -53,9 +53,10 @@
#include <QtCore/qstring.h>
#include <private/qtqmlglobal_p.h>
+#if QT_CONFIG(qml_debug)
#include <private/qqmldebugservice_p.h>
+#endif
#include <private/qqmldebugstatesdelegate_p.h>
-#include <private/qqmlabstractprofileradapter_p.h>
#include <private/qqmlboundsignal_p.h>
#include <limits>
@@ -65,7 +66,7 @@ QT_BEGIN_NAMESPACE
class QWindow;
class QQuickWindow;
-#ifdef QT_NO_QML_DEBUGGER
+#if !QT_CONFIG(qml_debug)
class QV4DebugService
{
@@ -120,6 +121,7 @@ protected:
QQmlDebugService(s_key, version, parent) {}
};
+class QQmlAbstractProfilerAdapter;
class Q_QML_PRIVATE_EXPORT QQmlProfilerService : public QQmlDebugService
{
Q_OBJECT
diff --git a/src/qml/debugger/qqmldebugstatesdelegate_p.h b/src/qml/debugger/qqmldebugstatesdelegate_p.h
index 95f727fb2d..b2e14873dc 100644
--- a/src/qml/debugger/qqmldebugstatesdelegate_p.h
+++ b/src/qml/debugger/qqmldebugstatesdelegate_p.h
@@ -57,7 +57,7 @@
QT_BEGIN_NAMESPACE
-#ifdef QT_NO_QML_DEBUGGER
+#if !QT_CONFIG(qml_debug)
class QQmlDebugStatesDelegate {};
diff --git a/src/qml/debugger/qqmlmemoryprofiler_p.h b/src/qml/debugger/qqmlmemoryprofiler_p.h
index fb71c999c3..12a31a851f 100644
--- a/src/qml/debugger/qqmlmemoryprofiler_p.h
+++ b/src/qml/debugger/qqmlmemoryprofiler_p.h
@@ -56,7 +56,7 @@
QT_BEGIN_NAMESPACE
-#ifdef QT_NO_QML_DEBUGGER
+#if !QT_CONFIG(qml_debug)
#define QML_MEMORY_SCOPE_URL(url)
#define QML_MEMORY_SCOPE_STRING(s)
diff --git a/src/qml/debugger/qqmlprofiler_p.h b/src/qml/debugger/qqmlprofiler_p.h
index 88f8e94f25..9ffe6ff247 100644
--- a/src/qml/debugger/qqmlprofiler_p.h
+++ b/src/qml/debugger/qqmlprofiler_p.h
@@ -55,15 +55,17 @@
#include <private/qqmlboundsignal_p.h>
#include <private/qfinitestack_p.h>
#include <private/qqmlbinding_p.h>
+#if QT_CONFIG(qml_debug)
#include "qqmlprofilerdefinitions_p.h"
#include "qqmlabstractprofileradapter_p.h"
+#endif
#include <QUrl>
#include <QString>
QT_BEGIN_NAMESPACE
-#ifdef QT_NO_QML_DEBUGGER
+#if !QT_CONFIG(qml_debug)
#define Q_QML_PROFILE_IF_ENABLED(feature, profiler, Code)
#define Q_QML_PROFILE(feature, profiler, Method)
@@ -450,6 +452,6 @@ QT_END_NAMESPACE
Q_DECLARE_METATYPE(QVector<QQmlProfilerData>)
Q_DECLARE_METATYPE(QQmlProfiler::LocationHash)
-#endif // QT_NO_QML_DEBUGGER
+#endif // QT_CONFIG(qml_debug)
#endif // QQMLPROFILER_P_H
diff --git a/src/qml/debugger/qqmlprofilerdefinitions_p.h b/src/qml/debugger/qqmlprofilerdefinitions_p.h
index c6ae4593a9..91d0376837 100644
--- a/src/qml/debugger/qqmlprofilerdefinitions_p.h
+++ b/src/qml/debugger/qqmlprofilerdefinitions_p.h
@@ -43,6 +43,8 @@
#include <private/qtqmlglobal_p.h>
#include <private/qv4profiling_p.h>
+QT_REQUIRE_CONFIG(qml_debug);
+
//
// W A R N I N G
// -------------
@@ -56,8 +58,6 @@
QT_BEGIN_NAMESPACE
-#ifndef QT_NO_QML_DEBUGGER
-
struct QQmlProfilerDefinitions {
enum Message {
Event,
@@ -163,8 +163,6 @@ struct QQmlProfilerDefinitions {
};
};
-#endif // QT_NO_QML_DEBUGGER
-
QT_END_NAMESPACE
#endif
diff --git a/src/qml/jsruntime/jsruntime.pri b/src/qml/jsruntime/jsruntime.pri
index 9938f60aea..ebdb3d6d03 100644
--- a/src/qml/jsruntime/jsruntime.pri
+++ b/src/qml/jsruntime/jsruntime.pri
@@ -42,7 +42,7 @@ SOURCES += \
$$PWD/qv4typedarray.cpp \
$$PWD/qv4dataview.cpp
-!contains(QT_CONFIG, no-qml-debug): SOURCES += $$PWD/qv4profiling.cpp
+qtConfig(qml-debug): SOURCES += $$PWD/qv4profiling.cpp
HEADERS += \
$$PWD/qv4global_p.h \
diff --git a/src/qml/jsruntime/qv4debugging_p.h b/src/qml/jsruntime/qv4debugging_p.h
index 8e2eec03d2..61a55964ab 100644
--- a/src/qml/jsruntime/qv4debugging_p.h
+++ b/src/qml/jsruntime/qv4debugging_p.h
@@ -59,7 +59,7 @@ QT_BEGIN_NAMESPACE
namespace QV4 {
namespace Debugging {
-#ifdef QT_NO_QML_DEBUGGER
+#if !QT_CONFIG(qml_debug)
class Debugger
{
diff --git a/src/qml/jsruntime/qv4engine.cpp b/src/qml/jsruntime/qv4engine.cpp
index 7b298a302c..b5edad69ae 100644
--- a/src/qml/jsruntime/qv4engine.cpp
+++ b/src/qml/jsruntime/qv4engine.cpp
@@ -518,7 +518,7 @@ ExecutionEngine::~ExecutionEngine()
delete [] argumentsAccessors;
}
-#ifndef QT_NO_QML_DEBUGGER
+#if QT_CONFIG(qml_debug)
void ExecutionEngine::setDebugger(Debugging::Debugger *debugger)
{
Q_ASSERT(!m_debugger);
@@ -530,7 +530,7 @@ void ExecutionEngine::setProfiler(Profiling::Profiler *profiler)
Q_ASSERT(!m_profiler);
m_profiler.reset(profiler);
}
-#endif // QT_NO_QML_DEBUGGER
+#endif // QT_CONFIG(qml_debug)
void ExecutionEngine::initRootContext()
{
diff --git a/src/qml/jsruntime/qv4engine_p.h b/src/qml/jsruntime/qv4engine_p.h
index 4549cda5b9..e4ac51efed 100644
--- a/src/qml/jsruntime/qv4engine_p.h
+++ b/src/qml/jsruntime/qv4engine_p.h
@@ -345,7 +345,7 @@ public:
ExecutionEngine(EvalISelFactory *iselFactory = 0);
~ExecutionEngine();
-#ifdef QT_NO_QML_DEBUGGER
+#if !QT_CONFIG(qml_debug)
QV4::Debugging::Debugger *debugger() const { return nullptr; }
QV4::Profiling::Profiler *profiler() const { return nullptr; }
@@ -357,7 +357,7 @@ public:
void setDebugger(Debugging::Debugger *debugger);
void setProfiler(Profiling::Profiler *profiler);
-#endif // QT_NO_QML_DEBUGGER
+#endif // QT_CONFIG(qml_debug)
ExecutionContext *pushGlobalContext();
void pushContext(Heap::ExecutionContext *context);
@@ -460,7 +460,7 @@ public:
private:
void failStackLimitCheck(Scope &scope);
-#ifndef QT_NO_QML_DEBUGGER
+#if QT_CONFIG(qml_debug)
QScopedPointer<QV4::Debugging::Debugger> m_debugger;
QScopedPointer<QV4::Profiling::Profiler> m_profiler;
#endif
diff --git a/src/qml/jsruntime/qv4profiling_p.h b/src/qml/jsruntime/qv4profiling_p.h
index 9de597ad0e..6b2369e795 100644
--- a/src/qml/jsruntime/qv4profiling_p.h
+++ b/src/qml/jsruntime/qv4profiling_p.h
@@ -57,7 +57,7 @@
#include <QElapsedTimer>
-#ifdef QT_NO_QML_DEBUGGER
+#if !QT_CONFIG(qml_debug)
#define Q_V4_PROFILE_ALLOC(engine, size, type) (!engine)
#define Q_V4_PROFILE_DEALLOC(engine, size, type) (!engine)
@@ -305,6 +305,6 @@ Q_DECLARE_METATYPE(QV4::Profiling::FunctionLocationHash)
Q_DECLARE_METATYPE(QVector<QV4::Profiling::FunctionCallProperties>)
Q_DECLARE_METATYPE(QVector<QV4::Profiling::MemoryAllocationProperties>)
-#endif // QT_NO_QML_DEBUGGER
+#endif // QT_CONFIG(qml_debug)
#endif // QV4PROFILING_H
diff --git a/src/qml/jsruntime/qv4vme_moth.cpp b/src/qml/jsruntime/qv4vme_moth.cpp
index 5749d0aef3..fdf47e772e 100644
--- a/src/qml/jsruntime/qv4vme_moth.cpp
+++ b/src/qml/jsruntime/qv4vme_moth.cpp
@@ -144,7 +144,7 @@ Q_QML_EXPORT int qt_v4DebuggerHook(const char *json);
} // extern "C"
-#ifndef QT_NO_QML_DEBUGGER
+#if QT_CONFIG(qml_debug)
static int qt_v4BreakpointCount = 0;
static bool qt_v4IsDebugging = true;
static bool qt_v4IsStepping = false;
@@ -287,7 +287,7 @@ static void qt_v4CheckForBreak(QV4::ExecutionContext *context)
}
}
-#endif // QT_NO_QML_DEBUGGER
+#endif // QT_CONFIG(qml_debug)
// End of debugger interface
using namespace QV4;
@@ -916,7 +916,7 @@ QV4::ReturnedValue VME::run(ExecutionEngine *engine, const uchar *code)
return VALUE(instr.result).asReturnedValue();
MOTH_END_INSTR(Ret)
-#ifndef QT_NO_QML_DEBUGGER
+#if QT_CONFIG(qml_debug)
MOTH_BEGIN_INSTR(Debug)
engine->current->lineNumber = instr.lineNumber;
QV4::Debugging::Debugger *debugger = engine->debugger();
@@ -931,7 +931,7 @@ QV4::ReturnedValue VME::run(ExecutionEngine *engine, const uchar *code)
if (qt_v4IsDebugging)
qt_v4CheckForBreak(engine->currentContext);
MOTH_END_INSTR(Line)
-#endif // QT_NO_QML_DEBUGGER
+#endif // QT_CONFIG(qml_debug)
MOTH_BEGIN_INSTR(LoadThis)
VALUE(instr.result) = engine->currentContext->thisObject();
diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp
index a3fe4cad0f..9ef47b2c2e 100644
--- a/src/qml/qml/qqmlengine.cpp
+++ b/src/qml/qml/qqmlengine.cpp
@@ -667,7 +667,7 @@ the same object as is returned from the Qt.include() call.
QQmlEnginePrivate::QQmlEnginePrivate(QQmlEngine *e)
: propertyCapture(0), rootContext(0),
-#ifndef QT_NO_QML_DEBUGGER
+#if QT_CONFIG(qml_debug)
profiler(0),
#endif
outputWarningsToMsgLog(true),
@@ -711,7 +711,7 @@ QQmlEnginePrivate::~QQmlEnginePrivate()
QMetaType::unregisterType(iter.value()->metaTypeId);
QMetaType::unregisterType(iter.value()->listMetaTypeId);
}
-#ifndef QT_NO_QML_DEBUGGER
+#if QT_CONFIG(qml_debug)
delete profiler;
#endif
}
diff --git a/src/qml/qml/qqmlengine_p.h b/src/qml/qml/qqmlengine_p.h
index fd74a233a4..791660cac7 100644
--- a/src/qml/qml/qqmlengine_p.h
+++ b/src/qml/qml/qqmlengine_p.h
@@ -135,7 +135,7 @@ public:
QQmlContext *rootContext;
-#ifdef QT_NO_QML_DEBUGGER
+#if !QT_CONFIG(qml_debug)
static const quintptr profiler = 0;
#else
QQmlProfiler *profiler;
diff --git a/src/qml/qml/qqmltypeloader.cpp b/src/qml/qml/qqmltypeloader.cpp
index b9d6c521de..494b3d30bc 100644
--- a/src/qml/qml/qqmltypeloader.cpp
+++ b/src/qml/qml/qqmltypeloader.cpp
@@ -962,7 +962,7 @@ void QQmlTypeLoader::invalidate()
#endif // qml_network
}
-#ifndef QT_NO_QML_DEBUGGER
+#if QT_CONFIG(qml_debug)
void QQmlTypeLoader::setProfiler(QQmlProfiler *profiler)
{
Q_ASSERT(!m_profiler);
diff --git a/src/qml/qml/qqmltypeloader_p.h b/src/qml/qml/qqmltypeloader_p.h
index ef63e02b4f..94552cd5a0 100644
--- a/src/qml/qml/qqmltypeloader_p.h
+++ b/src/qml/qml/qqmltypeloader_p.h
@@ -321,13 +321,13 @@ public:
void initializeEngine(QQmlExtensionInterface *, const char *);
void invalidate();
-#ifdef QT_NO_QML_DEBUGGER
+#if !QT_CONFIG(qml_debug)
quintptr profiler() const { return 0; }
void setProfiler(quintptr) {}
#else
QQmlProfiler *profiler() const { return m_profiler.data(); }
void setProfiler(QQmlProfiler *profiler);
-#endif // QT_NO_QML_DEBUGGER
+#endif // QT_CONFIG(qml_debug)
private:
@@ -379,7 +379,7 @@ private:
QQmlEngine *m_engine;
QQmlTypeLoaderThread *m_thread;
-#ifndef QT_NO_QML_DEBUGGER
+#if QT_CONFIG(qml_debug)
QScopedPointer<QQmlProfiler> m_profiler;
#endif
diff --git a/src/qml/qtqmlglobal.h b/src/qml/qtqmlglobal.h
index 387c28a945..6e92867cf5 100644
--- a/src/qml/qtqmlglobal.h
+++ b/src/qml/qtqmlglobal.h
@@ -50,6 +50,8 @@
# if QT_CONFIG(qml_network)
# include <QtNetwork/qtnetworkglobal.h>
# endif
+#else
+# define QT_FEATURE_qml_debug -1
#endif
QT_BEGIN_NAMESPACE
diff --git a/src/qmltest/qmltest.pro b/src/qmltest/qmltest.pro
index d13e162ff4..48546d5f64 100644
--- a/src/qmltest/qmltest.pro
+++ b/src/qmltest/qmltest.pro
@@ -30,6 +30,6 @@ HEADERS += \
$$PWD/quicktestresult_p.h \
$$PWD/qtestoptions_p.h
-!contains(QT_CONFIG, no-qml-debug): DEFINES += QT_QML_DEBUG_NO_WARNING
+qtConfig(qml-debug): DEFINES += QT_QML_DEBUG_NO_WARNING
load(qt_module)
diff --git a/src/quick/qtquick2.cpp b/src/quick/qtquick2.cpp
index c6b89fabd3..00fc23645b 100644
--- a/src/quick/qtquick2.cpp
+++ b/src/quick/qtquick2.cpp
@@ -62,7 +62,7 @@ static void initResources()
QT_BEGIN_NAMESPACE
-#ifdef QT_NO_QML_DEBUGGER
+#if !QT_CONFIG(qml_debug)
class QQmlQtQuick2DebugStatesDelegate : public QQmlDebugStatesDelegate {};
@@ -181,7 +181,7 @@ void QQmlQtQuick2DebugStatesDelegate::resetBindingForInvalidProperty(QObject *ob
}
}
-#endif // QT_NO_QML_DEBUGGER
+#endif // QT_CONFIG(qml_debug)
void QQmlQtQuick2Module::defineModule()
{
diff --git a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
index d016e79641..0da35fba42 100644
--- a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
+++ b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
@@ -55,6 +55,7 @@
#include <QtGui/QOpenGLFunctions_1_0>
#include <QtGui/QOpenGLFunctions_3_2_Core>
+#include <private/qnumeric_p.h>
#include <private/qquickprofiler_p.h>
#include "qsgmaterialshader_p.h"
diff --git a/src/quick/util/qquickprofiler_p.h b/src/quick/util/qquickprofiler_p.h
index d2fa935ad4..38027a6abf 100644
--- a/src/quick/util/qquickprofiler_p.h
+++ b/src/quick/util/qquickprofiler_p.h
@@ -52,9 +52,12 @@
//
#include <QtCore/private/qabstractanimation_p.h>
-#include <QtQml/private/qqmlprofilerdefinitions_p.h>
#include <QtQuick/private/qtquickglobal_p.h>
+#if QT_CONFIG(qml_debug)
+#include <QtQml/private/qqmlprofilerdefinitions_p.h>
+#endif
+
#include <QtCore/qurl.h>
#include <QtCore/qsize.h>
#include <QtCore/qmutex.h>
@@ -62,7 +65,7 @@
QT_BEGIN_NAMESPACE
-#ifdef QT_NO_QML_DEBUGGER
+#if !QT_CONFIG(qml_debug)
#define Q_QUICK_PROFILE_IF_ENABLED(feature, Code)
@@ -358,7 +361,7 @@ protected:
void setTimer(const QElapsedTimer &t);
};
-#endif // QT_NO_QML_DEBUGGER
+#endif // QT_CONFIG(qml_debug)
#define Q_QUICK_PROFILE(feature, Method)\
Q_QUICK_PROFILE_IF_ENABLED(feature, QQuickProfiler::Method)
diff --git a/src/quick/util/util.pri b/src/quick/util/util.pri
index b53b132cce..edcb268cd9 100644
--- a/src/quick/util/util.pri
+++ b/src/quick/util/util.pri
@@ -28,7 +28,7 @@ SOURCES += \
$$PWD/qquicktextmetrics.cpp \
$$PWD/qquickvalidator.cpp
-!contains(QT_CONFIG, no-qml-debug): SOURCES += $$PWD/qquickprofiler.cpp
+qtConfig(qml-debug): SOURCES += $$PWD/qquickprofiler.cpp
HEADERS += \
$$PWD/qquickapplication_p.h\
diff --git a/src/src.pro b/src/src.pro
index 3bb399acd4..42bf90e092 100644
--- a/src/src.pro
+++ b/src/src.pro
@@ -1,7 +1,8 @@
TEMPLATE = subdirs
CONFIG += ordered
+include($$OUT_PWD/qml/qtqml-config.pri)
include($$OUT_PWD/quick/qtquick-config.pri)
-QT_FOR_CONFIG += network quick-private
+QT_FOR_CONFIG += network qml quick-private
SUBDIRS += \
qml
@@ -20,4 +21,4 @@ SUBDIRS += \
imports \
qmldevtools
-qtConfig(localserver):!contains(QT_CONFIG, no-qml-debug): SUBDIRS += qmldebug
+qtConfig(localserver):qtConfig(qml-debug): SUBDIRS += qmldebug
diff --git a/tests/auto/qml/qml.pro b/tests/auto/qml/qml.pro
index 9eb500f537..05528eea30 100644
--- a/tests/auto/qml/qml.pro
+++ b/tests/auto/qml/qml.pro
@@ -1,4 +1,5 @@
TEMPLATE = subdirs
+QT_FOR_CONFIG += qml
METATYPETESTS += \
qqmlmetatype
@@ -82,7 +83,7 @@ qtHaveModule(widgets) {
SUBDIRS += $$PUBLICTESTS
SUBDIRS += $$METATYPETESTS
qtConfig(process) {
- !contains(QT_CONFIG, no-qml-debug): SUBDIRS += debugger
+ qtConfig(qml-debug): SUBDIRS += debugger
!boot2qt {
SUBDIRS += qmllint qmlplugindump
}
diff --git a/tools/qml/qml.pro b/tools/qml/qml.pro
index 3aa8af18bc..04704f9314 100644
--- a/tools/qml/qml.pro
+++ b/tools/qml/qml.pro
@@ -14,6 +14,6 @@ mac {
ICON = qml.icns
}
-!contains(QT_CONFIG, no-qml-debug): DEFINES += QT_QML_DEBUG_NO_WARNING
+qtConfig(qml-debug): DEFINES += QT_QML_DEBUG_NO_WARNING
load(qt_tool)
diff --git a/tools/qmlscene/qmlscene.pro b/tools/qmlscene/qmlscene.pro
index 6a7df90ccc..dcc46e17c7 100644
--- a/tools/qmlscene/qmlscene.pro
+++ b/tools/qmlscene/qmlscene.pro
@@ -5,7 +5,7 @@ CONFIG += no_import_scan
SOURCES += main.cpp
DEFINES += QML_RUNTIME_TESTING
-!contains(QT_CONFIG, no-qml-debug): DEFINES += QT_QML_DEBUG_NO_WARNING
+qtConfig(qml-debug): DEFINES += QT_QML_DEBUG_NO_WARNING
QMAKE_TARGET_DESCRIPTION = QML Scene Viewer