forked from qt-creator/qt-creator
QmlDesigner: Disable Qml*Parser if there is no QmlDom
We simple provide an empty implementation. The project storage is anyway not used by default. So it is expected that the programmer is providing a qml dom if he wants to use the project storage. Change-Id: Ib652e7589b4f773a4474974f6762490c5d515999 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
@@ -50,6 +50,28 @@ add_qtc_plugin(QmlDesigner
|
|||||||
include(qmldesignercore.cmake)
|
include(qmldesignercore.cmake)
|
||||||
extend_with_qmldesigner_core(QmlDesigner)
|
extend_with_qmldesigner_core(QmlDesigner)
|
||||||
|
|
||||||
|
get_filename_component(
|
||||||
|
QMLDOM_STANDALONE_CMAKELISTS
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/../../../../qmldom_standalone/src/qmldom/standalone/"
|
||||||
|
ABSOLUTE
|
||||||
|
)
|
||||||
|
|
||||||
|
if(EXISTS ${QMLDOM_STANDALONE_CMAKELISTS} AND Qt6_FOUND AND NOT TARGET qmldomlib)
|
||||||
|
add_subdirectory(
|
||||||
|
../../../../qmldom_standalone/src/qmldom/standalone
|
||||||
|
${CMAKE_BINARY_DIR}/qmldom_standalone)
|
||||||
|
|
||||||
|
set_target_properties(qmldomlib PROPERTIES
|
||||||
|
RUNTIME_OUTPUT_DIRECTORY "$<TARGET_PROPERTY:QmlJS,RUNTIME_OUTPUT_DIRECTORY>"
|
||||||
|
LIBRARY_OUTPUT_DIRECTORY "$<TARGET_PROPERTY:QmlJS,LIBRARY_OUTPUT_DIRECTORY>")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
extend_qtc_target(QmlDesigner
|
||||||
|
CONDITION TARGET qmldomlib
|
||||||
|
DEFINES QDS_HAS_QMLDOM
|
||||||
|
DEPENDS qmldomlib
|
||||||
|
)
|
||||||
|
|
||||||
if (QTC_STATIC_BUILD AND TARGET QmlDesigner)
|
if (QTC_STATIC_BUILD AND TARGET QmlDesigner)
|
||||||
get_target_property(_designerType Qt5::Designer TYPE)
|
get_target_property(_designerType Qt5::Designer TYPE)
|
||||||
if (${_designerType} STREQUAL "STATIC_LIBRARY")
|
if (${_designerType} STREQUAL "STATIC_LIBRARY")
|
||||||
|
@@ -30,13 +30,17 @@
|
|||||||
|
|
||||||
#include <sqlitedatabase.h>
|
#include <sqlitedatabase.h>
|
||||||
|
|
||||||
|
#ifdef QDS_HAS_QMLDOM
|
||||||
#include <qmldom/qqmldomtop_p.h>
|
#include <qmldom/qqmldomtop_p.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
|
|
||||||
namespace QmlDesigner {
|
namespace QmlDesigner {
|
||||||
|
|
||||||
|
#ifdef QDS_HAS_QMLDOM
|
||||||
|
|
||||||
namespace QmlDom = QQmlJS::Dom;
|
namespace QmlDom = QQmlJS::Dom;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
@@ -195,4 +199,15 @@ Storage::Type QmlDocumentParser::parse(const QString &sourceContent,
|
|||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
Storage::Type QmlDocumentParser::parse([[maybe_unused]] const QString &sourceContent,
|
||||||
|
[[maybe_unused]] Storage::Imports &imports,
|
||||||
|
[[maybe_unused]] SourceId sourceId,
|
||||||
|
[[maybe_unused]] Utils::SmallStringView directoryPath)
|
||||||
|
{
|
||||||
|
return Storage::Type{};
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
} // namespace QmlDesigner
|
} // namespace QmlDesigner
|
||||||
|
@@ -30,8 +30,10 @@
|
|||||||
|
|
||||||
#include <sqlitedatabase.h>
|
#include <sqlitedatabase.h>
|
||||||
|
|
||||||
|
#ifdef QDS_HAS_QMLDOM
|
||||||
#include <qmlcompiler/qqmljstypedescriptionreader_p.h>
|
#include <qmlcompiler/qqmljstypedescriptionreader_p.h>
|
||||||
#include <qmldom/qqmldomtop_p.h>
|
#include <qmldom/qqmldomtop_p.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
|
|
||||||
@@ -40,6 +42,7 @@
|
|||||||
|
|
||||||
namespace QmlDesigner {
|
namespace QmlDesigner {
|
||||||
|
|
||||||
|
#ifdef QDS_HAS_QMLDOM
|
||||||
namespace QmlDom = QQmlJS::Dom;
|
namespace QmlDom = QQmlJS::Dom;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
@@ -304,4 +307,14 @@ void QmlTypesParser::parse(const QString &sourceContent,
|
|||||||
addTypes(types, projectData, components, m_storage);
|
addTypes(types, projectData, components, m_storage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
void QmlTypesParser::parse([[maybe_unused]] const QString &sourceContent,
|
||||||
|
[[maybe_unused]] Storage::Imports &imports,
|
||||||
|
[[maybe_unused]] Storage::Types &types,
|
||||||
|
[[maybe_unused]] const Storage::ProjectData &projectData)
|
||||||
|
{}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
} // namespace QmlDesigner
|
} // namespace QmlDesigner
|
||||||
|
Reference in New Issue
Block a user