Bootstrap: depopulate qcore_mac.mm to remove QOperatingSystemVersion

We don't need anything that the class provided, but we needed it because
everything is in a large .mm source file.

I've also removed portions of qcore_mac.mm that aren't needed for
bootstrapped tools, like telling whether dark mode is in effect (the
bootstrapped tools aren't GUI). I've also had to remove the check for
running under Rosetta, which hopefully is going to affect no one:
running moc & cmake_automoc_parser under Rosetta is going to be mighty
slow. Just use a native set of tools instead.

Change-Id: I4c0c716a5b57833abf63fffdf0c66b9ebaccffdb
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
This commit is contained in:
Thiago Macieira 2025-01-08 08:25:45 -08:00
parent b717945812
commit d7007090bb
3 changed files with 6 additions and 5 deletions

View File

@ -322,7 +322,7 @@ QDebug operator<<(QDebug debug, const QCFString &string)
}
#endif // !QT_NO_DEBUG_STREAM
#ifdef Q_OS_MACOS
#if defined(Q_OS_MACOS) && !defined(QT_BOOTSTRAPPED)
bool qt_mac_applicationIsInDarkMode()
{
auto appearance = [NSApp.effectiveAppearance bestMatchFromAppearancesWithNames:
@ -563,6 +563,7 @@ QMacRootLevelAutoReleasePool::~QMacRootLevelAutoReleasePool()
// -------------------------------------------------------------------------
#ifndef QT_BOOTSTRAPPED
void qt_apple_check_os_version()
{
#if defined(__WATCH_OS_VERSION_MIN_REQUIRED)
@ -610,6 +611,7 @@ void qt_apple_check_os_version()
}
}
Q_CONSTRUCTOR_FUNCTION(qt_apple_check_os_version);
#endif // QT_BOOTSTRAPPED
// -------------------------------------------------------------------------
@ -656,6 +658,7 @@ QT_BEGIN_NAMESPACE
// -------------------------------------------------------------------------
#ifndef QT_BOOTSTRAPPED
QOperatingSystemVersion QMacVersion::buildSDK(VersionTarget target)
{
switch (target) {
@ -775,6 +778,7 @@ QMacVersion::VersionTuple QMacVersion::libraryVersion()
}();
return version;
}
#endif // QT_BOOTSTRAPPED
// -------------------------------------------------------------------------

View File

@ -981,7 +981,7 @@ static bool isJitEnabled()
#ifdef QT_DEBUG
return false;
#elif defined(Q_OS_MACOS)
#elif defined(Q_OS_MACOS) && !defined(QT_BOOTSTRAPPED)
return !qt_mac_runningUnderRosetta();
#else
return true;

View File

@ -127,11 +127,8 @@ qt_internal_extend_target(Bootstrap CONDITION MSVC AND CLANG
qt_internal_extend_target(Bootstrap CONDITION APPLE
SOURCES
../../corelib/global/qoperatingsystemversion.cpp
../../corelib/global/qoperatingsystemversion_darwin.mm
../../corelib/kernel/qcore_foundation.mm
../../corelib/kernel/qcore_mac.mm
../../corelib/tools/qversionnumber.cpp
PUBLIC_LIBRARIES
${FWFoundation}
)