Skip to content

Commit d0e59a7

Browse files
committed
Add current dir to include directories when compiling resource
Fixes #15206
1 parent f09cd0f commit d0e59a7

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

mesonbuild/modules/windows.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,9 @@ def compile_resources(self, state: 'ModuleState',
155155
build.IncludeDirs('', [], False, [os.path.join('@BUILD_ROOT@', self.interpreter.backend.get_target_dir(d))])
156156
])
157157
include_directories = self.interpreter.extract_incdirs(kwargs)
158+
self_dir = build.IncludeDirs(state.subdir, ['.'], False)
159+
if self_dir not in include_directories:
160+
include_directories.append(self_dir)
158161
extra_args += state.get_include_args(include_directories)
159162

160163
rescomp, rescomp_type = self._find_resource_compiler(state)

test cases/windows/15 resource scripts with duplicate filenames/meson.build

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
project('foobar', 'c')
22

3+
if meson.get_compiler('c').get_id() == 'gcc' and host_machine.system() == 'windows'
4+
error('MESON_SKIP_TEST windres has internal error when adding . to include path')
5+
endif
6+
37
win = import('windows')
48

59
subdir('a')

0 commit comments

Comments
 (0)