From 8f146e109ed8a858dd3717c132e5c384f57a22e5 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 26 Jan 2023 14:14:31 +0100 Subject: [PATCH] QtCore: Add exclusions for Unity builds Task-number: QTBUG-109394 Change-Id: I055fbc29e85cbb58af9c5a423f6f7be4fbb0c40a Reviewed-by: Thiago Macieira (cherry picked from commit fc3a9ee60159b2391cba2320cfdeeddb94d781f8) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/CMakeLists.txt | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index 59362e02f48..19c3b749d4d 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -699,6 +699,13 @@ qt_internal_extend_target(Core CONDITION UNIX thread/qthread_unix.cpp ) +# Necessary for defining DT_* macros, otherwise they cause +# error during UNITY_BUILD. +qt_internal_extend_target(Core CONDITION APPLE + DEFINES + _DEFAULT_SOURCE +) + qt_internal_extend_target(Core CONDITION QT_FEATURE_thread SOURCES thread/qatomic.cpp @@ -1340,12 +1347,29 @@ set_source_files_properties( thread/qmutex_unix.cpp PROPERTIES HEADER_FILE_ONLY ON) # special case: These files are included by qmutex.cpp! +set_source_files_properties(serialization/qcborstreamwriter.cpp # CBOR macro clashes + io/forkfd_qt.cpp # EINTR_LOOP macro clashes + global/qglobal.cpp # undef qFatal + global/qlogging.cpp # undef qFatal + ${corelib_no_pch_sources} # NO_PCH_SOURCES + PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON) # Remove QT_NO_CAST_TO_ASCII to ensure that the symbols are included in the library. if(WIN32) get_target_property(defines Core COMPILE_DEFINITIONS) list(REMOVE_ITEM defines QT_NO_CAST_TO_ASCII) set_target_properties(Core PROPERTIES COMPILE_DEFINITIONS "${defines}") + + set_source_files_properties(global/qsimd.cpp # Q_DECL_INIT_PRIORITY + serialization/qcborvalue.cpp # various windows.h clashes + serialization/qjsoncbor.cpp + serialization/qjsonvalue.cpp + serialization/qxmlstream.cpp + text/qbytearray.cpp + text/qlatin1stringmatcher.cpp + text/qunicodetools.cpp + tools/qhash.cpp # Q_DECL_INIT_PRIORITY + PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON) endif() qt_internal_apply_gc_binaries_conditional(Core PUBLIC)