-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[qtbase] fix macdeployqt for symlinks
when building for *-osx-dynamic, symlinks to handle version suffix are created for the shared libs. Macdeployqt does not preserve the symlinks, which results in multiple copies of the same library causing crashes.
- Loading branch information
Showing
5 changed files
with
41 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
diff --git a/src/tools/macdeployqt/shared/shared.cpp b/src/tools/macdeployqt/shared/shared.cpp | ||
index 6ff269b..caffd44 100644 | ||
--- a/src/tools/macdeployqt/shared/shared.cpp | ||
+++ b/src/tools/macdeployqt/shared/shared.cpp | ||
@@ -1,4 +1,5 @@ | ||
// Copyright (C) 2016 The Qt Company Ltd. | ||
+ | ||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 | ||
#include <QCoreApplication> | ||
#include <QString> | ||
@@ -85,7 +86,21 @@ | ||
} | ||
} | ||
|
||
- if (QFile::copy(from, to)) { | ||
+ QFileInfo fromFileInfo(from); | ||
+ | ||
+ if (fromFileInfo.isSymLink()) { | ||
+ const QString fromSymLinkTarget = fromFileInfo.absoluteDir().relativeFilePath(fromFileInfo.symLinkTarget()); | ||
+ if (QFile::link(fromSymLinkTarget, to)) { | ||
+ return copyFilePrintStatus(fromFileInfo.absoluteDir().absoluteFilePath(fromSymLinkTarget), QFileInfo(to).absoluteDir().absoluteFilePath(fromSymLinkTarget)); | ||
+ } | ||
+ else { | ||
+ LogError() << "symlink copy failed from" << from; | ||
+ LogError() << " to" << to; | ||
+ return false; | ||
+ } | ||
+ | ||
+ } | ||
+ else if (QFile::copy(from, to)) { | ||
QFile dest(to); | ||
dest.setPermissions(dest.permissions() | QFile::WriteOwner | QFile::WriteUser); | ||
LogNormal() << " copied:" << from; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters