From fc277e3ff655780622bcbc0b664efc69fbc33537 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 7 Apr 2025 08:55:16 +0200 Subject: [PATCH] Fix linker errors when building bootstrap lib on macOS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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ø Reviewed-by: Thiago Macieira --- src/corelib/io/qfilesystemengine_unix.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp index 3dcca8e264c..caffdf10df1 100644 --- a/src/corelib/io/qfilesystemengine_unix.cpp +++ b/src/corelib/io/qfilesystemengine_unix.cpp @@ -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/