diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2022-01-19 12:42:25 -0800 |
---|---|---|
committer | Eli Schwartz <eschwartz93@gmail.com> | 2022-01-28 15:53:20 -0500 |
commit | 11f96380351a88059ec55f1070fdebc1b1033117 (patch) | |
tree | 3577f52920c3e2159f193605a894cb090b95ec10 /mesonbuild/modules/windows.py | |
parent | b402817fb6f0392812bfa272bdbc05c9c30139fa (diff) | |
download | meson-11f96380351a88059ec55f1070fdebc1b1033117.zip meson-11f96380351a88059ec55f1070fdebc1b1033117.tar.gz meson-11f96380351a88059ec55f1070fdebc1b1033117.tar.bz2 |
build: replace kwargs in CustomTarget initializer
Because we don't want to pass the Interpreter kwargs into the build
layer. This turned out to be a mega commit, as there's really on elegant
way to make this change in an incremental way. On the nice side, mypy
made this change super easy, as nearly all of the calls to
`CustomTarget` are fully type checked!
It also turns out that we're not handling install_tags in custom_target
correctly, since we're not converting the boolean values into Optional
values!
Diffstat (limited to 'mesonbuild/modules/windows.py')
-rw-r--r-- | mesonbuild/modules/windows.py | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/mesonbuild/modules/windows.py b/mesonbuild/modules/windows.py index 5f7301d..eb07ced 100644 --- a/mesonbuild/modules/windows.py +++ b/mesonbuild/modules/windows.py @@ -181,26 +181,25 @@ class WindowsModule(ExtensionModule): command: T.List[T.Union[str, ExternalProgram]] = [] command.append(rescomp) command.extend(res_args) - - res_kwargs: 'RcKwargs' = { - 'output': output, - 'input': [src], - 'depfile': None, - 'depend_files': wrc_depend_files, - 'depends': wrc_depends, - 'command': [], - } - + depfile: T.Optional[str] = None # instruct binutils windres to generate a preprocessor depfile if rescomp_type == ResourceCompilerType.windres: - res_kwargs['depfile'] = f'{output}.d' + depfile = f'{output}.d' command.extend(['--preprocessor-arg=-MD', '--preprocessor-arg=-MQ@OUTPUT@', '--preprocessor-arg=-MF@DEPFILE@']) - res_kwargs['command'] = command - - res_targets.append(build.CustomTarget(name_formatted, state.subdir, state.subproject, res_kwargs)) + res_targets.append(build.CustomTarget( + name_formatted, + state.subdir, + state.subproject, + command, + [src], + [output], + depfile=depfile, + depend_files=wrc_depend_files, + extra_depends=wrc_depends, + )) return ModuleReturnValue(res_targets, [res_targets]) |