Deploying Qt: Clean up .cpp.o(bj) files when deploying Qt

These files are required when building against some static libraries
that Qt ships. Since we don't link against these libraries, we used to
remove them when we install Qt, but starting with Qt 6.5 some of these
files are required by the Qt CMake files, and configuration would fail.

So, we now have to remove them when deploying Qt, instead of already
when installing Qt.

Change-Id: Ie38ab3735b86df0372b946d6a808007b5ec84b88
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
This commit is contained in:
Eike Ziller
2022-12-16 11:23:54 +01:00
parent 70b3388684
commit 77dfa71f06
2 changed files with 8 additions and 2 deletions

View File

@@ -110,9 +110,12 @@ def is_ignored_windows_file(use_debug, basepath, filename):
return False
def ignored_qt_lib_files(path, filenames):
# Qt ships some unneeded object files in the qml plugins
# On Windows we also do not want to ship the wrong debug/release .dlls or .lib files etc
if not common.is_windows_platform():
return []
return [fn for fn in filenames if is_ignored_windows_file(debug_build, path, fn)]
return [fn for fn in filenames if fn.endswith('.cpp.o')]
return [fn for fn in filenames
if fn.endswith('.cpp.obj') or is_ignored_windows_file(debug_build, path, fn)]
def copy_qt_libs(target_qt_prefix_path, qt_bin_dir, qt_libs_dir, qt_plugin_dir, qt_qml_dir, plugins):
print("copying Qt libraries...")

View File

@@ -145,6 +145,9 @@ if [ ! -d "$app_path/Contents/Frameworks/QtCore.framework" ]; then
fi
# clean up unneeded object files that are part of Qt for some static libraries
find "$app_path" -ipath "*/objects-*" -delete
# clean up after macdeployqt
# it deploys some plugins (and libs for these) that interfere with what we want
echo "Cleaning up after macdeployqt..."