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.

Pick-to: 6.9
Fixes: QTBUG-135650
Change-Id: Icf7995abfae368b9f5bd5c4ccfcf4c3c6664d519
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Joerg Bornemann 2025-04-07 08:55:16 +02:00
parent 86c250d98f
commit fc277e3ff6

View File

@ -1274,9 +1274,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()
@ -1291,6 +1289,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/