QtCore: Add exclusions for Unity builds

Task-number: QTBUG-109394
Change-Id: I055fbc29e85cbb58af9c5a423f6f7be4fbb0c40a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit fc3a9ee60159b2391cba2320cfdeeddb94d781f8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Friedemann Kleint 2023-01-26 14:14:31 +01:00 committed by Qt Cherry-pick Bot
parent 29c6d4ac90
commit 8f146e109e

View File

@ -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)