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 8fea3ec4e7.

Change-Id: I568800401bb5af153b7bb5229f134c2f74b87468
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CMake Build Bot
bb10
Alexandru Croitor 2019-06-04 22:40:42 +02:00 committed by Kevin Funk
parent 003e0bb8ff
commit 9231204e2c
1 changed files with 6 additions and 3 deletions

View File

@ -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')