From 5e423751275d0130dcc57d339fc8f8802967bffa Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 27 Jan 2023 12:47:57 +0100 Subject: [PATCH] QtWidgets: Fix CMake Unity (Jumbo) builds Remove clashing enumeration value ColumnCount and exclude file in snippets. Task-number: QTBUG-109394 Change-Id: Ibd8a72d9d87e3dcbbb221c364d6b4c4f59b315df Reviewed-by: Axel Spoerl (cherry picked from commit e73389874d6f8dbfc4743c51eb3d3889dd2da7fb) --- src/widgets/CMakeLists.txt | 5 +++++ src/widgets/doc/snippets/customviewstyle/CMakeLists.txt | 2 ++ src/widgets/kernel/qformlayout.cpp | 4 +--- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/widgets/CMakeLists.txt b/src/widgets/CMakeLists.txt index d0c0790921e..a3e5a6c713b 100644 --- a/src/widgets/CMakeLists.txt +++ b/src/widgets/CMakeLists.txt @@ -70,6 +70,11 @@ qt_internal_add_module(Widgets GENERATE_CPP_EXPORTS ) +if(APPLE) + set_source_files_properties(kernel/qapplication.cpp + PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON) +endif() + # Resources: set(qstyle_resource_files "styles/images/cdr-128.png" diff --git a/src/widgets/doc/snippets/customviewstyle/CMakeLists.txt b/src/widgets/doc/snippets/customviewstyle/CMakeLists.txt index d424b583a49..04f89b83b63 100644 --- a/src/widgets/doc/snippets/customviewstyle/CMakeLists.txt +++ b/src/widgets/doc/snippets/customviewstyle/CMakeLists.txt @@ -12,3 +12,5 @@ target_link_libraries(widgets_customviewstyle_snippets PRIVATE Qt::Gui Qt::Widgets ) + +set_target_properties(widgets_customviewstyle_snippets PROPERTIES UNITY_BUILD OFF) diff --git a/src/widgets/kernel/qformlayout.cpp b/src/widgets/kernel/qformlayout.cpp index 7e58273a906..01097b61233 100644 --- a/src/widgets/kernel/qformlayout.cpp +++ b/src/widgets/kernel/qformlayout.cpp @@ -68,8 +68,6 @@ void FixedColumnMatrix::storageIndexToPosition(int idx, int *rowP const uint DefaultFieldGrowthPolicy = 255; const uint DefaultRowWrapPolicy = 255; -enum { ColumnCount = 2 }; - // -- our data structure for our items // This owns the QLayoutItem struct QFormLayoutItem @@ -152,7 +150,7 @@ class QFormLayoutPrivate : public QLayoutPrivate Q_DECLARE_PUBLIC(QFormLayout) public: - typedef QtPrivate::FixedColumnMatrix ItemMatrix; + using ItemMatrix = QtPrivate::FixedColumnMatrix; QFormLayoutPrivate(); ~QFormLayoutPrivate() { }