diff --git a/src/xml/CMakeLists.txt b/src/xml/CMakeLists.txt index e0c31eeabd9..65e13db7e7e 100644 --- a/src/xml/CMakeLists.txt +++ b/src/xml/CMakeLists.txt @@ -7,8 +7,6 @@ qt_internal_add_module(Xml SOURCES - dom/qdom.cpp dom/qdom.h dom/qdom_p.h - dom/qdomhelpers.cpp dom/qdomhelpers_p.h qtxmlglobal.h DEFINES QT_NO_CONTEXTLESS_CONNECT @@ -23,13 +21,17 @@ qt_internal_add_module(Xml Qt::CorePrivate ) -## Scopes: -##################################################################### +qt_internal_extend_target(Xml CONDITION QT_FEATURE_dom + SOURCES + dom/qdom.cpp dom/qdom.h dom/qdom_p.h + dom/qdomhelpers.cpp dom/qdomhelpers_p.h +) qt_internal_extend_target(Xml CONDITION MSVC AND (TEST_architecture_arch STREQUAL "i386") LINK_OPTIONS "/BASE:0x61000000" ) + qt_internal_add_docs(Xml doc/qtxml.qdocconf ) diff --git a/src/xml/dom/qdom.cpp b/src/xml/dom/qdom.cpp index a9c2a648582..043fd3a6855 100644 --- a/src/xml/dom/qdom.cpp +++ b/src/xml/dom/qdom.cpp @@ -5,7 +5,7 @@ #include #include "private/qxmlutils_p.h" -#ifndef QT_NO_DOM +#if QT_CONFIG(dom) #include "qdom_p.h" #include "qdomhelpers_p.h" @@ -6983,4 +6983,4 @@ QDomComment QDomNode::toComment() const QT_END_NAMESPACE -#endif // QT_NO_DOM +#endif // feature dom diff --git a/src/xml/dom/qdom.h b/src/xml/dom/qdom.h index a3900609c40..0ac7d9130e9 100644 --- a/src/xml/dom/qdom.h +++ b/src/xml/dom/qdom.h @@ -7,13 +7,12 @@ #include #include +#if QT_CONFIG(dom) + class tst_QDom; QT_BEGIN_NAMESPACE - -#ifndef QT_NO_DOM - class QIODevice; class QTextStream; @@ -666,8 +665,8 @@ private: Q_XML_EXPORT QTextStream& operator<<(QTextStream& stream, const QDomNode& node); -#endif // QT_NO_DOM - QT_END_NAMESPACE +#endif // feature dom + #endif // QDOM_H diff --git a/src/xml/dom/qdom_p.h b/src/xml/dom/qdom_p.h index b2ecd534c88..2a8e2deac0c 100644 --- a/src/xml/dom/qdom_p.h +++ b/src/xml/dom/qdom_p.h @@ -11,6 +11,7 @@ #include #include +QT_REQUIRE_CONFIG(dom); QT_BEGIN_NAMESPACE // diff --git a/src/xml/dom/qdomhelpers.cpp b/src/xml/dom/qdomhelpers.cpp index 0649e0c75d8..c41529f289d 100644 --- a/src/xml/dom/qdomhelpers.cpp +++ b/src/xml/dom/qdomhelpers.cpp @@ -3,7 +3,7 @@ #include -#ifndef QT_NO_DOM +#if QT_CONFIG(dom) #include "qdomhelpers_p.h" #include "qdom_p.h" @@ -442,4 +442,4 @@ bool QDomParser::parseMarkupDecl() QT_END_NAMESPACE -#endif // QT_NO_DOM +#endif // feature dom diff --git a/src/xml/dom/qdomhelpers_p.h b/src/xml/dom/qdomhelpers_p.h index 5a4b2207f9a..6a27fe09d0d 100644 --- a/src/xml/dom/qdomhelpers_p.h +++ b/src/xml/dom/qdomhelpers_p.h @@ -7,6 +7,7 @@ #include #include +QT_REQUIRE_CONFIG(dom); QT_BEGIN_NAMESPACE // diff --git a/tests/auto/xml/CMakeLists.txt b/tests/auto/xml/CMakeLists.txt index 92ac1870f69..6c770d18eb6 100644 --- a/tests/auto/xml/CMakeLists.txt +++ b/tests/auto/xml/CMakeLists.txt @@ -1,3 +1,6 @@ # Copyright (C) 2024 The Qt Company Ltd. # SPDX-License-Identifier: BSD-3-Clause -add_subdirectory(dom) + +if(QT_FEATURE_dom) + add_subdirectory(dom) +endif() diff --git a/tests/auto/xml/dom/qdom/tst_qdom.cpp b/tests/auto/xml/dom/qdom/tst_qdom.cpp index b73dbc49e27..d77ecc811d8 100644 --- a/tests/auto/xml/dom/qdom/tst_qdom.cpp +++ b/tests/auto/xml/dom/qdom/tst_qdom.cpp @@ -17,6 +17,7 @@ #include #include +QT_REQUIRE_CONFIG(dom); QT_FORWARD_DECLARE_CLASS(QDomDocument) QT_FORWARD_DECLARE_CLASS(QDomNode)