From 11592ad3fc9085f720034a3b9838c365edbc131e Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Thu, 4 Jul 2024 11:14:31 +0200 Subject: [PATCH] CMake: Fix unity build for gcc < 13 GCC 12 erroneously yields -Wsubobject-linkage in a unity build. Un-unity qresource.cpp for GCC 12 and older. Change-Id: Ie3aced2668ec8aae797d89ce28a3e5917a6e8f88 Reviewed-by: Alexey Edelev Reviewed-by: Alexandru Croitor (cherry picked from commit a06e54d2c88934f1511768d7254e12e6294e6336) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index ed3a544e3f3..bb0fd0bb9f3 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -594,6 +594,11 @@ qt_internal_extend_target(Core CONDITION WIN32 tools/qhash.cpp # Q_DECL_INIT_PRIORITY ) +qt_internal_extend_target(Core CONDITION GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "13" + NO_UNITY_BUILD_SOURCES + io/qresource.cpp io/qresource.h io/qresource_p.h # -Werror=subobject-linkage +) + if(NOT WIN32) ### Qt7: remove # Make qwineventnotifier.h available on non-Windows platforms too for code bases that include