aboutsummaryrefslogtreecommitdiffstats
path: root/build_scripts/utils.py
diff options
context:
space:
mode:
authorCristián Maureira-Fredes <Cristian.Maureira-Fredes@qt.io>2022-06-27 20:02:34 +0200
committerCristian Maureira-Fredes <cristian.maureira-fredes@qt.io>2022-06-28 09:04:04 +0000
commit50c746d61fdf521e98557ec34dc21f9413c2a465 (patch)
tree02fa7d65fd9a2b7ebf9c72018f597783fefaca50 /build_scripts/utils.py
parentd8e9b867560dafe1baa75356dbb65a177c74b6d2 (diff)
build: avoid mutable default value as argument
Mainly to avoid having a persistent object every time we call the function, to avoid future issues. Pick-to: 6.2 6.3 Change-Id: I9aea45ffa7ecd381e8c5ed6b3c83036d6e8aef72 Reviewed-by: Shyamnath Premnadh <Shyamnath.Premnadh@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'build_scripts/utils.py')
-rw-r--r--build_scripts/utils.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/build_scripts/utils.py b/build_scripts/utils.py
index 0c69ba87c..6a8eaa054 100644
--- a/build_scripts/utils.py
+++ b/build_scripts/utils.py
@@ -615,8 +615,8 @@ def macos_fix_rpaths_for_library(library_path, qt_lib_dir):
macos_add_qt_rpath(library_path, qt_lib_dir, existing_rpath_commands, install_names)
-def macos_add_qt_rpath(library_path, qt_lib_dir, existing_rpath_commands=[],
- library_dependencies=[]):
+def macos_add_qt_rpath(library_path, qt_lib_dir, existing_rpath_commands=None,
+ library_dependencies=None):
"""
Adds an rpath load command to the Qt lib directory if necessary
@@ -624,6 +624,12 @@ def macos_add_qt_rpath(library_path, qt_lib_dir, existing_rpath_commands=[],
and adds an rpath load command that points to the Qt lib directory
(qt_lib_dir).
"""
+ if existing_rpath_commands is None:
+ existing_rpath_commands = []
+
+ if library_dependencies is None:
+ library_dependencies = []
+
if not existing_rpath_commands:
existing_rpath_commands = macos_get_rpaths(library_path)