diff options
Diffstat (limited to 'util/cmake')
-rwxr-xr-x | util/cmake/configurejson2cmake.py | 1 | ||||
-rwxr-xr-x | util/cmake/pro2cmake.py | 15 |
2 files changed, 15 insertions, 1 deletions
diff --git a/util/cmake/configurejson2cmake.py b/util/cmake/configurejson2cmake.py index 29753bf641..f479732406 100755 --- a/util/cmake/configurejson2cmake.py +++ b/util/cmake/configurejson2cmake.py @@ -742,7 +742,6 @@ def parseFeature(ctx, feature, data, cm_fh): "profile": None, "qmakeargs": None, "qpa_default_platform": None, # Not a bool! - "reduce_relocations": None, "release": None, "release_tools": None, "rpath_dir": None, # rpath related diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index fca5d4fceb..43d608e219 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -2519,6 +2519,19 @@ def write_simd_part(cm_fh: IO[str], target: str, scope: Scope, indent: int = 0): cm_fh.write(extend_scope) +def write_reduce_relocations_part(cm_fh: IO[str], target: str, scope: Scope, indent: int = 0): + ind = spaces(indent) + dynlist_file = scope.get_files("QMAKE_DYNAMIC_LIST_FILE") + if dynlist_file: + dynlist_path = "${CMAKE_CURRENT_LIST_DIR}/" + dynlist_file[0] + cm_fh.write(f'{ind}if(QT_FEATURE_reduce_relocations AND UNIX AND GCC)\n') + ind = spaces(indent + 1) + cm_fh.write(f'{ind}target_link_options({target} PRIVATE\n') + cm_fh.write(f'{ind} "LINKER:--dynamic-list={dynlist_path}")\n') + ind = spaces(indent) + cm_fh.write(f'{ind}endif()\n') + + def write_android_part(cm_fh: IO[str], target: str, scope: Scope, indent: int = 0): keys = [ "ANDROID_BUNDLED_JAR_DEPENDENCIES", @@ -2825,6 +2838,8 @@ def write_main_part( write_simd_part(cm_fh, name, scope, indent) + write_reduce_relocations_part(cm_fh, name, scope, indent) + write_android_part(cm_fh, name, scopes[0], indent) write_wayland_part(cm_fh, name, scopes[0], indent) |