diff --git a/cmake/Utils.cmake b/cmake/Utils.cmake index e7fa26d918d..766b6ff755e 100644 --- a/cmake/Utils.cmake +++ b/cmake/Utils.cmake @@ -100,4 +100,22 @@ function(configure_qml_designer Qt6_VERSION) env_with_default("QTC_IS_SUPPORTED_PROJECTSTORAGE_QT" ENV_QTC_IS_SUPPORTED_PROJECTSTORAGE_QT ${QTC_IS_SUPPORTED_PROJECTSTORAGE_QT_DEFAULT}) option(IS_SUPPORTED_PROJECTSTORAGE_QT "IS_SUPPORTED_PROJECTSTORAGE_QT" ${ENV_QTC_IS_SUPPORTED_PROJECTSTORAGE_QT}) add_feature_info("IS_SUPPORTED_PROJECTSTORAGE_QT" ${IS_SUPPORTED_PROJECTSTORAGE_QT} "is ${IS_SUPPORTED_PROJECTSTORAGE_QT}") + + # to enable define QML_DOM_MSVC2019_COMPAT if necessary, see QTBUG-127761 + if(NOT DEFINED QT_BUILT_WITH_MSVC2019) + get_target_property(QT_QMAKE_EXECUTABLE Qt6::qmake IMPORTED_LOCATION) + + execute_process( + COMMAND dumpbin /headers ${QT_QMAKE_EXECUTABLE} | findstr /c:"linker version" + OUTPUT_VARIABLE DUMPBIN_OUTPUT + ) + + string(FIND "${DUMPBIN_OUTPUT}" "14.2" QT_BUILT_WITH_MSVC2019) + + if(QT_BUILT_WITH_MSVC2019 GREATER -1) + set(QT_BUILT_WITH_MSVC2019 TRUE CACHE BOOL "Qt was built with MSVC 2019") + else() + set(QT_BUILT_WITH_MSVC2019 FALSE CACHE BOOL "Qt was not built with MSVC 2019") + endif() + endif() endfunction() diff --git a/src/plugins/qmldesigner/libs/designercore/CMakeLists.txt b/src/plugins/qmldesigner/libs/designercore/CMakeLists.txt index 61ed67663f8..fbca41645d5 100644 --- a/src/plugins/qmldesigner/libs/designercore/CMakeLists.txt +++ b/src/plugins/qmldesigner/libs/designercore/CMakeLists.txt @@ -368,11 +368,15 @@ extend_qtc_library(QmlDesignerCore storagecachefwd.h ) +extend_qtc_library(QmlDesignerCore + CONDITION QT_BUILT_WITH_MSVC2019 + DEFINES QML_DOM_MSVC2019_COMPAT +) + extend_qtc_library(QmlDesignerCore SOURCES_PREFIX projectstorage PUBLIC_INCLUDES projectstorage SOURCES_PROPERTIES SKIP_AUTOGEN ON - DEFINES QML_DOM_MSVC2019_COMPAT # can be removed for Qt 6.8 SOURCES commontypecache.h directorypathcompressor.h