From 9231204e2ccab611af0df9a18761cd601ba20e92 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Tue, 4 Jun 2019 22:40:42 +0200 Subject: [PATCH] Fix extra_keys in write_all_source_file_lists to be optional Initially it was added as a required argument, but not all usages of the function where adjusted, so the script failed. Make it optional. Also change the styling of the argument to be snake cased. Amends 8fea3ec4e77dfebe2e84e10ae0f014d03b9098b3. Change-Id: I568800401bb5af153b7bb5229f134c2f74b87468 Reviewed-by: Simon Hausmann Reviewed-by: Qt CMake Build Bot --- util/cmake/pro2cmake.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 072fd4a08b..98706d1064 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -1140,9 +1140,12 @@ def write_source_file_list(cm_fh: typing.IO[str], scope, cmake_parameter: str, def write_all_source_file_lists(cm_fh: typing.IO[str], scope: Scope, header: str, *, - indent: int = 0, footer: str = '', extraKeys: typing.List[str]): + indent: int = 0, footer: str = '', + extra_keys: typing.Union[typing.List[str], None] = None): + if extra_keys is None: + extra_keys = [] write_source_file_list(cm_fh, scope, header, - ['SOURCES', 'HEADERS', 'OBJECTIVE_SOURCES', 'NO_PCH_SOURCES', 'FORMS'] + extraKeys, + ['SOURCES', 'HEADERS', 'OBJECTIVE_SOURCES', 'NO_PCH_SOURCES', 'FORMS'] + extra_keys, indent, footer=footer) @@ -1700,7 +1703,7 @@ def write_example(cm_fh: typing.IO[str], scope: Scope, if gui: add_executable += ' WIN32 MACOSX_BUNDLE' - write_all_source_file_lists(cm_fh, scope, add_executable, indent=0, extraKeys = ['RESOURCES']) + write_all_source_file_lists(cm_fh, scope, add_executable, indent=0, extra_keys=['RESOURCES']) cm_fh.write(')\n')