summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAmir Masoud Abdol <amir.abdol@qt.io>2023-03-09 15:04:19 +0100
committerAmir Masoud Abdol <amir.abdol@qt.io>2023-03-14 17:28:44 +0100
commitf4228163fb8f0f7e257aa6e824c2387cf0a6370e (patch)
treed448d79ed4257c3d2905a892004436069bb24800 /src
parent3e9f2a0adbf0aecc652f559acaad865ca5ad1858 (diff)
Exclude a few source files from QtCore
On macOS, if QtCore is built with unity build, tst_qmakelib will fail. For now, we decided to exclude the qsystemerror.cpp on macOS. The _DARWIN_C_SOURCE provides a few necessary macros on macOS. By defining the macro we can include the qfilesystemengine_unix.cpp and qlockfile_unix.cpp into the unity build again. Pick-to: 6.5 Task-number: QTBUG-109394 Change-Id: I2c8b38b0512792c21966582c33471b7ee222617a Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/CMakeLists.txt20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt
index 09ed1f9e77..abc4058bf3 100644
--- a/src/corelib/CMakeLists.txt
+++ b/src/corelib/CMakeLists.txt
@@ -310,6 +310,11 @@ qt_internal_add_module(Core
tools/qvarlengtharray.h
tools/qvector.h
tools/qversionnumber.cpp tools/qversionnumber.h
+ NO_UNITY_BUILD_SOURCES
+ # MinGW complains about `free-nonheap-object` in ~QSharedDataPointer()
+ # despite the fact that appropriate checks are in place to avoid that!
+ tools/qshareddata.cpp tools/qshareddata.h
+ text/qlocale.cpp text/qlocale.h
DEFINES
QT_NO_FOREACH
QT_NO_USING_NAMESPACE
@@ -563,6 +568,15 @@ qt_internal_extend_target(Core CONDITION APPLE
${FWFoundation}
PUBLIC_LIBRARIES
${FWIOKit}
+ DEFINES
+ _DARWIN_C_SOURCE # This resolves two issues,
+ # - Provide DT_* macros to qfilesystemengine_unix.cpp
+ # - Enables SOCK_MAXADDRLEN in case its missing during the unity build
+ NO_UNITY_BUILD_SOURCES
+ kernel/qsystemerror.cpp
+ # This makes sure that the tst_qmakelib passes. For some reason,
+ # QtCore ends up returning a corrupted error message in
+ # write_file(): fail
)
qt_internal_extend_target(Core CONDITION MACOS
@@ -627,12 +641,6 @@ qt_internal_extend_target(Core CONDITION UNIX
thread/qthread_unix.cpp
)
-qt_internal_extend_target(Core CONDITION APPLE
- NO_UNITY_BUILD_SOURCES
- io/qfilesystemengine_unix.cpp # avoid undefined DT_* macros
- io/qlockfile_unix.cpp # avoid undefined SOCK_MAXADDRLEN (in proc_info.h)
-)
-
qt_internal_extend_target(Core CONDITION QT_FEATURE_thread
SOURCES
thread/qatomic.cpp