Skip to content

Commit 34b7582

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

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

mesonbuild/build.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -512,8 +512,8 @@ def to_string_list(self, sourcedir: str, builddir: str) -> T.List[str]:
512512
"""
513513
strlist: T.List[str] = []
514514
for idir in self.incdirs:
515-
strlist.append(os.path.join(sourcedir, self.curdir, idir))
516-
strlist.append(os.path.join(builddir, self.curdir, idir))
515+
strlist.append(os.path.normpath(os.path.join(sourcedir, self.curdir, idir)))
516+
strlist.append(os.path.normpath(os.path.join(builddir, self.curdir, idir)))
517517
return strlist
518518

519519
@dataclass(eq=False)

mesonbuild/modules/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
from __future__ import annotations
77
import dataclasses
8+
import os.path
89
import typing as T
910

1011
from .. import build, mesonlib
@@ -66,8 +67,8 @@ def get_include_args(self, include_dirs: T.Iterable[T.Union[str, build.IncludeDi
6667
if isinstance(dirs, str):
6768
dirs_str += [f'{prefix}{dirs}']
6869
else:
69-
dirs_str.extend([f'{prefix}{i}' for i in dirs.to_string_list(srcdir, builddir)])
70-
dirs_str.extend([f'{prefix}{i}' for i in dirs.get_extra_build_dirs()])
70+
dirs_str.extend([f'{prefix}{os.path.normpath(i)}' for i in dirs.to_string_list(srcdir, builddir)])
71+
dirs_str.extend([f'{prefix}{os.path.normpath(i)}' for i in dirs.get_extra_build_dirs()])
7172

7273
return dirs_str
7374

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)

0 commit comments

Comments
 (0)