diff options
| author | Jussi Pakkanen <jussi.pakkanen@mailbox.org> | 2025-11-25 11:58:56 +0200 |
|---|---|---|
| committer | Jussi Pakkanen <jussi.pakkanen@mailbox.org> | 2025-11-30 14:58:49 +0200 |
| commit | 1e19f93b1e1cfd83e4009c6b664dfccf10aeded6 (patch) | |
| tree | 110fe589c51f098d44526f220737afb92b3a1c77 /mesonbuild/modules/windows.py | |
| parent | a696f7473bdb0730074028f6e4655155881620a2 (diff) | |
| download | meson-1e19f93b1e1cfd83e4009c6b664dfccf10aeded6.tar.gz | |
Revert "Detect dependency changes in Windows rc compiler"
This reverts commit 632115ecff3bd7f9cb519098e04e0467b0cfd3a1.
Diffstat (limited to 'mesonbuild/modules/windows.py')
| -rw-r--r-- | mesonbuild/modules/windows.py | 46 |
1 files changed, 5 insertions, 41 deletions
diff --git a/mesonbuild/modules/windows.py b/mesonbuild/modules/windows.py index 3250c072c..a24c40593 100644 --- a/mesonbuild/modules/windows.py +++ b/mesonbuild/modules/windows.py @@ -22,13 +22,13 @@ if T.TYPE_CHECKING: from . import ModuleState from ..compilers import Compiler from ..interpreter import Interpreter - from ..interpreter.interpreter import SourceOutputs from typing_extensions import TypedDict class CompileResources(TypedDict): + depend_files: T.List[mesonlib.FileOrString] - depends: T.List[T.Union[build.BuildTarget, build.CustomTarget, build.CustomTargetIndex]] + depends: T.List[T.Union[build.BuildTarget, build.CustomTarget]] include_directories: T.List[T.Union[str, build.IncludeDirs]] args: T.List[str] @@ -108,33 +108,6 @@ class WindowsModule(ExtensionModule): return self._rescomp - def get_preprocessor_target(self, - name_formatted: str, - src: T.Union[str, mesonlib.File, build.CustomTarget, build.CustomTargetIndex], - include_directories: T.List[build.IncludeDirs], - state: ModuleState) -> build.CustomTargetIndex: - compiler = self.detect_compiler(state.environment.coredata.compilers[MachineChoice.HOST]) - _sources: T.List[T.Union[mesonlib.File, build.CustomTarget, build.CustomTargetIndex, build.GeneratedList]] = self.interpreter.source_strings_to_files([src]) - sources = T.cast('T.List[SourceOutputs]', _sources) - - tg = build.CompileTarget( - name_formatted, - state.subdir, - state.subproject, - state.environment, - sources, - '@PLAINNAME@.i', - compiler.get_preprocessor(), - state.backend, - ['-DRC_INVOKED'], - include_directories, - [], - []) - self.interpreter.add_target(tg.name, tg) - - private_dir = os.path.relpath(state.backend.get_target_private_dir(tg), state.subdir) - return build.CustomTargetIndex(tg, os.path.join(private_dir, tg.outputs[0])) - @typed_pos_args('windows.compile_resources', varargs=(str, mesonlib.File, build.CustomTarget, build.CustomTargetIndex), min_varargs=1) @typed_kwargs( 'windows.compile_resources', @@ -154,8 +127,7 @@ class WindowsModule(ExtensionModule): extra_args += state.get_include_args([ build.IncludeDirs('', [], False, [os.path.join('@BUILD_ROOT@', self.interpreter.backend.get_target_dir(d))]) ]) - include_directories = self.interpreter.extract_incdirs(kwargs) - extra_args += state.get_include_args(include_directories) + extra_args += state.get_include_args(kwargs['include_directories']) rescomp, rescomp_type = self._find_resource_compiler(state) if rescomp_type == ResourceCompilerType.rc: @@ -212,20 +184,12 @@ class WindowsModule(ExtensionModule): command.append(rescomp) command.extend(res_args) depfile: T.Optional[str] = None - extra_depends = wrc_depends.copy() + # instruct binutils windres to generate a preprocessor depfile if rescomp_type == ResourceCompilerType.windres: - # instruct binutils windres to generate a preprocessor depfile depfile = f'{output}.d' command.extend(['--preprocessor-arg=-MD', '--preprocessor-arg=-MQ@OUTPUT@', '--preprocessor-arg=-MF@DEPFILE@']) - elif rescomp_type == ResourceCompilerType.rc: - # use preprocessor to detect header dependencies - extra_depends.append(self.get_preprocessor_target( - name_formatted + '_i', - src, - include_directories, - state)) res_targets.append(build.CustomTarget( name_formatted, @@ -237,7 +201,7 @@ class WindowsModule(ExtensionModule): [output], depfile=depfile, depend_files=wrc_depend_files, - extra_depends=extra_depends, + extra_depends=wrc_depends, description='Compiling Windows resource {}', )) |
