From e5598520b46b298f2e8c01a15e60403485e0e652 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 27 Jan 2023 11:26:22 +0100 Subject: [PATCH] Add some exclusions for CMake Unity (Jumbo) builds Add exclusions for issues that are likely not fixable (3rd party code, X11 define clashes, etc) in 3rd party, tools and plugins. Task-number: QTBUG-109394 Done-with: Amir Masoud Abdol Change-Id: I698c004201a76a48389271c130e44fba20f5adf7 Reviewed-by: Joerg Bornemann Reviewed-by: Qt CI Bot (cherry picked from commit 64dc6fe87d05aaad3ce516747ad6dbd048f388cb) Reviewed-by: Qt Cherry-pick Bot --- qmake/CMakeLists.txt | 1 + src/3rdparty/freetype/CMakeLists.txt | 2 ++ src/3rdparty/harfbuzz-ng/CMakeLists.txt | 2 ++ src/3rdparty/libjpeg/CMakeLists.txt | 2 ++ src/3rdparty/zlib/CMakeLists.txt | 2 ++ src/gui/CMakeLists.txt | 7 +++++++ src/opengl/CMakeLists.txt | 8 ++++++++ src/plugins/imageformats/ico/CMakeLists.txt | 2 ++ .../eglfs/deviceintegration/eglfs_x11/CMakeLists.txt | 2 ++ src/plugins/platforms/windows/CMakeLists.txt | 4 ++++ src/plugins/platforms/xcb/CMakeLists.txt | 2 ++ .../xcb/gl_integrations/xcb_egl/CMakeLists.txt | 2 ++ .../xcb/gl_integrations/xcb_glx/CMakeLists.txt | 2 ++ src/plugins/tls/openssl/CMakeLists.txt | 4 ++++ src/printsupport/CMakeLists.txt | 11 +++++++++++ src/sql/CMakeLists.txt | 3 +++ src/tools/bootstrap/CMakeLists.txt | 2 +- src/tools/tracegen/CMakeLists.txt | 4 ++++ 18 files changed, 61 insertions(+), 1 deletion(-) diff --git a/qmake/CMakeLists.txt b/qmake/CMakeLists.txt index 9be6b92d683..c9014f35fd8 100644 --- a/qmake/CMakeLists.txt +++ b/qmake/CMakeLists.txt @@ -133,6 +133,7 @@ set_target_properties(${target_name} PROPERTIES AUTOMOC OFF AUTORCC OFF AUTOUIC OFF + UNITY_BUILD OFF ) qt_internal_apply_gc_binaries(${target_name} PRIVATE) # special case diff --git a/src/3rdparty/freetype/CMakeLists.txt b/src/3rdparty/freetype/CMakeLists.txt index 720a98bee15..ac7fb8480b9 100644 --- a/src/3rdparty/freetype/CMakeLists.txt +++ b/src/3rdparty/freetype/CMakeLists.txt @@ -73,6 +73,8 @@ qt_internal_add_3rdparty_library(BundledFreetype $ ) +set_target_properties(BundledFreetype PROPERTIES UNITY_BUILD OFF) + qt_internal_add_3rdparty_header_module(FreetypePrivate EXTERNAL_HEADERS_DIR include ) diff --git a/src/3rdparty/harfbuzz-ng/CMakeLists.txt b/src/3rdparty/harfbuzz-ng/CMakeLists.txt index 83566064b33..b18179e6d0d 100644 --- a/src/3rdparty/harfbuzz-ng/CMakeLists.txt +++ b/src/3rdparty/harfbuzz-ng/CMakeLists.txt @@ -68,6 +68,8 @@ qt_internal_add_3rdparty_library(BundledHarfbuzz $ ) +set_target_properties(BundledHarfbuzz PROPERTIES UNITY_BUILD OFF) + qt_internal_add_sync_header_dependencies(BundledHarfbuzz Core) # GHS compiler doesn't support the __restrict keyword diff --git a/src/3rdparty/libjpeg/CMakeLists.txt b/src/3rdparty/libjpeg/CMakeLists.txt index d1da6c6849f..13e54119bed 100644 --- a/src/3rdparty/libjpeg/CMakeLists.txt +++ b/src/3rdparty/libjpeg/CMakeLists.txt @@ -60,6 +60,8 @@ qt_internal_add_3rdparty_library(BundledLibjpeg $ ) +set_target_properties(BundledLibjpeg PROPERTIES UNITY_BUILD OFF) + qt_internal_add_3rdparty_header_module(JpegPrivate EXTERNAL_HEADERS src/jpeglib.h diff --git a/src/3rdparty/zlib/CMakeLists.txt b/src/3rdparty/zlib/CMakeLists.txt index ee9ece80fc3..81fc649538d 100644 --- a/src/3rdparty/zlib/CMakeLists.txt +++ b/src/3rdparty/zlib/CMakeLists.txt @@ -34,6 +34,8 @@ qt_internal_add_3rdparty_library(BundledZLIB $ ) +set_target_properties(BundledZLIB PROPERTIES UNITY_BUILD OFF) + qt_internal_add_sync_header_dependencies(BundledZLIB Core) qt_disable_warnings(BundledZLIB) diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index c1bf00fd0a8..5b8bc278e9d 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -293,6 +293,13 @@ set(qpdf_resource_files "painting/qpdfa_metadata.xml" ) +set_source_files_properties(painting/qdrawhelper.cpp # NO_PCH_SOURCES + PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON) + +if(WIN32 OR (UNIX AND NOT APPLE)) + set_target_properties(Gui PROPERTIES UNITY_BUILD OFF) # X11 define clashes/Windows oddities. +endif() + qt_internal_add_resource(Gui "qpdf" PREFIX "/qpdf/" diff --git a/src/opengl/CMakeLists.txt b/src/opengl/CMakeLists.txt index 3f3a0d43b8d..1729f1b12d5 100644 --- a/src/opengl/CMakeLists.txt +++ b/src/opengl/CMakeLists.txt @@ -48,6 +48,14 @@ qt_internal_add_module(OpenGL GENERATE_CPP_EXPORTS ) +# qDebug()<< ambiguities +set_source_files_properties(qopengltextureblitter.cpp PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON) + +if(APPLE) + set_source_files_properties(qopenglversionfunctionsfactory.cpp + PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON) +endif() + ## Scopes: ##################################################################### diff --git a/src/plugins/imageformats/ico/CMakeLists.txt b/src/plugins/imageformats/ico/CMakeLists.txt index d590489307c..6417c1d9d44 100644 --- a/src/plugins/imageformats/ico/CMakeLists.txt +++ b/src/plugins/imageformats/ico/CMakeLists.txt @@ -16,3 +16,5 @@ qt_internal_add_plugin(QICOPlugin Qt::CorePrivate Qt::Gui ) + +set_target_properties(QICOPlugin PROPERTIES UNITY_BUILD OFF) diff --git a/src/plugins/platforms/eglfs/deviceintegration/eglfs_x11/CMakeLists.txt b/src/plugins/platforms/eglfs/deviceintegration/eglfs_x11/CMakeLists.txt index 21699aab274..5e91d67ccd7 100644 --- a/src/plugins/platforms/eglfs/deviceintegration/eglfs_x11/CMakeLists.txt +++ b/src/plugins/platforms/eglfs/deviceintegration/eglfs_x11/CMakeLists.txt @@ -25,3 +25,5 @@ qt_internal_add_plugin(QEglFSX11IntegrationPlugin X11::XCB XCB::XCB ) + +set_target_properties(QEglFSX11IntegrationPlugin PROPERTIES UNITY_BUILD OFF) # X11 define clashes diff --git a/src/plugins/platforms/windows/CMakeLists.txt b/src/plugins/platforms/windows/CMakeLists.txt index 33ccbf6a0a5..4425e78b304 100644 --- a/src/plugins/platforms/windows/CMakeLists.txt +++ b/src/plugins/platforms/windows/CMakeLists.txt @@ -66,6 +66,10 @@ qt_internal_add_plugin(QWindowsIntegrationPlugin runtimeobject ) +# Duplicated symbols +set_source_files_properties(qwindowspointerhandler.cpp qwindowsmousehandler.cpp + PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON) + # Resources: set_source_files_properties("openglblacklists/default.json" PROPERTIES QT_RESOURCE_ALIAS "default.json" diff --git a/src/plugins/platforms/xcb/CMakeLists.txt b/src/plugins/platforms/xcb/CMakeLists.txt index 3303f194870..4f019dde5aa 100644 --- a/src/plugins/platforms/xcb/CMakeLists.txt +++ b/src/plugins/platforms/xcb/CMakeLists.txt @@ -62,6 +62,8 @@ qt_internal_add_module(XcbQpaPrivate XKB::XKB ) +set_target_properties(XcbQpaPrivate PROPERTIES UNITY_BUILD OFF) # X11 define clashes + qt_disable_apple_app_extension_api_only(XcbQpaPrivate) ## Scopes: diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/CMakeLists.txt b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/CMakeLists.txt index c67ccd1cb14..98ea3c9e435 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_egl/CMakeLists.txt +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_egl/CMakeLists.txt @@ -29,3 +29,5 @@ qt_internal_add_plugin(QXcbEglIntegrationPlugin Qt::XcbQpaPrivate EGL::EGL ) + +set_target_properties(QXcbEglIntegrationPlugin PROPERTIES UNITY_BUILD OFF) # X11 define clashes diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/CMakeLists.txt b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/CMakeLists.txt index 13787eb9e70..a7fdbe0b984 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/CMakeLists.txt +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/CMakeLists.txt @@ -27,6 +27,8 @@ qt_internal_add_plugin(QXcbGlxIntegrationPlugin Qt::XcbQpaPrivate ) +set_target_properties(QXcbGlxIntegrationPlugin PROPERTIES UNITY_BUILD OFF) # X11 define clashes + ## Scopes: ##################################################################### diff --git a/src/plugins/tls/openssl/CMakeLists.txt b/src/plugins/tls/openssl/CMakeLists.txt index de712666dae..0e0a7a1552d 100644 --- a/src/plugins/tls/openssl/CMakeLists.txt +++ b/src/plugins/tls/openssl/CMakeLists.txt @@ -24,6 +24,10 @@ qt_internal_add_plugin(QTlsBackendOpenSSLPlugin OPENSSL_API_COMPAT=0x10100000L ) +if (WIN32) # Windows header issues + set_target_properties(QTlsBackendOpenSSLPlugin PROPERTIES UNITY_BUILD OFF) +endif() + qt_internal_extend_target(QTlsBackendOpenSSLPlugin CONDITION QT_FEATURE_dtls SOURCES qdtls_openssl.cpp qdtls_openssl_p.h diff --git a/src/printsupport/CMakeLists.txt b/src/printsupport/CMakeLists.txt index 83ab9cddebc..330f44c6892 100644 --- a/src/printsupport/CMakeLists.txt +++ b/src/printsupport/CMakeLists.txt @@ -42,6 +42,10 @@ qt_internal_add_module(PrintSupport "(^|/)qplatform.+\\.h$" ) +if(WIN32) # Static plugin link errors + set_target_properties(PrintSupport PROPERTIES UNITY_BUILD OFF) +endif() + ## Scopes: ##################################################################### @@ -73,6 +77,10 @@ qt_internal_extend_target(PrintSupport CONDITION WIN32 "platform/windows/qwindowsprintersupport.cpp" ) +set_source_files_properties(platform/macos/qcocoaprintersupport.mm # NO_PCH_SOURCES + platform/windows/qwindowsprintersupport.cpp + PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON) + qt_internal_extend_target(PrintSupport CONDITION QT_FEATURE_printpreviewwidget SOURCES kernel/qpaintengine_preview.cpp kernel/qpaintengine_preview_p.h @@ -186,6 +194,9 @@ qt_internal_extend_target(PrintSupport CONDITION QT_FEATURE_printdialog AND UNIX uic ) +# Clashes with CUPS headers +set_source_files_properties(dialogs/qprintdialog_unix.cpp PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON) + qt_internal_extend_target(PrintSupport CONDITION QT_FEATURE_printpreviewdialog SOURCES dialogs/qprintpreviewdialog.cpp dialogs/qprintpreviewdialog.h diff --git a/src/sql/CMakeLists.txt b/src/sql/CMakeLists.txt index a7e139655a2..e69df530a94 100644 --- a/src/sql/CMakeLists.txt +++ b/src/sql/CMakeLists.txt @@ -38,6 +38,9 @@ qt_internal_add_module(Sql GENERATE_CPP_EXPORTS ) +set_source_files_properties(compat/removed_api.cpp # NO_PCH_SOURCES + PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON) + ## Scopes: ##################################################################### diff --git a/src/tools/bootstrap/CMakeLists.txt b/src/tools/bootstrap/CMakeLists.txt index 232b6fcdfed..0919159b59a 100644 --- a/src/tools/bootstrap/CMakeLists.txt +++ b/src/tools/bootstrap/CMakeLists.txt @@ -226,7 +226,7 @@ qt_internal_extend_target(Bootstrap CONDITION MINGW AND WIN32 target_link_libraries(Bootstrap PRIVATE PlatformCommonInternal) qt_internal_apply_gc_binaries(Bootstrap PUBLIC) -set_target_properties(Bootstrap PROPERTIES AUTOMOC OFF AUTOUIC OFF AUTORCC OFF) +set_target_properties(Bootstrap PROPERTIES AUTOMOC OFF AUTOUIC OFF AUTORCC OFF UNITY_BUILD OFF) qt_internal_add_target_aliases(Bootstrap) qt_set_msvc_cplusplus_options(Bootstrap PUBLIC) qt_set_common_target_properties(Bootstrap) diff --git a/src/tools/tracegen/CMakeLists.txt b/src/tools/tracegen/CMakeLists.txt index 2bcdfe42b0b..42b0cbcf77b 100644 --- a/src/tools/tracegen/CMakeLists.txt +++ b/src/tools/tracegen/CMakeLists.txt @@ -21,3 +21,7 @@ qt_internal_add_tool(${target_name} tracegen.cpp ) qt_internal_return_unless_building_tools() + +set_target_properties(${target_name} PROPERTIES + UNITY_BUILD OFF +)