summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2019-06-04 22:40:42 +0200
committerKevin Funk <kevin.funk@kdab.com>2019-06-05 07:39:10 +0000
commit9231204e2ccab611af0df9a18761cd601ba20e92 (patch)
treeb98316b39f5013d9ce174bbd63f024def1f799df /util
parent003e0bb8ff3fcb4dbc74e1e199eb3fd2454166be (diff)
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 <simon.hausmann@qt.io> Reviewed-by: Qt CMake Build Bot
Diffstat (limited to 'util')
-rwxr-xr-xutil/cmake/pro2cmake.py9
1 files 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')