Fix linker errors when building bootstrap lib on macOS

The bootstrap lib doesn't build qfilesystemengine_mac.mm, and that's
where QFileSystemEngine::supportsMoveFileToTrash and
QFileSystemEngine::moveFileToTrash are implemented.

Make sure that the preprocessor picks up the QT_BOOTSTRAPPED condition
first to define implementations for the two methods.

Fixes: QTBUG-135650
Change-Id: Icf7995abfae368b9f5bd5c4ccfcf4c3c6664d519
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit fc277e3ff655780622bcbc0b664efc69fbc33537)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Joerg Bornemann 2025-04-07 08:55:16 +02:00 committed by Qt Cherry-pick Bot
parent b3b836e703
commit 13871ee86b

View File

@ -1236,9 +1236,7 @@ bool QFileSystemEngine::createLink(const QFileSystemEntry &source, const QFileSy
return false;
}
#ifdef Q_OS_DARWIN
// see qfilesystemengine_mac.mm
#elif defined(QT_BOOTSTRAPPED) || !defined(AT_FDCWD) || defined(Q_OS_ANDROID) || !QT_CONFIG(datestring) || defined(Q_OS_VXWORKS)
#if defined(QT_BOOTSTRAPPED) || !defined(AT_FDCWD) || defined(Q_OS_ANDROID) || !QT_CONFIG(datestring) || defined(Q_OS_VXWORKS)
// bootstrapped tools don't need this, and we don't want QStorageInfo
//static
bool QFileSystemEngine::supportsMoveFileToTrash()
@ -1253,6 +1251,8 @@ bool QFileSystemEngine::moveFileToTrash(const QFileSystemEntry &, QFileSystemEnt
error = QSystemError(ENOSYS, QSystemError::StandardLibraryError);
return false;
}
#elif defined(Q_OS_DARWIN)
// see qfilesystemengine_mac.mm
#else
/*
Implementing as per https://specifications.freedesktop.org/trash-spec/1.0/