diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2022-03-18 10:28:38 -0700 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2022-03-18 19:46:24 -0700 |
commit | f9445300b3015308fd6a3e0305cf8e5b7f002211 (patch) | |
tree | e63608c837b8d37b6924485cc7c8cf688355c449 /mesonbuild/backend | |
parent | 7c20890a05481e97eee57a147f50237087a1c94e (diff) | |
download | meson-f9445300b3015308fd6a3e0305cf8e5b7f002211.zip meson-f9445300b3015308fd6a3e0305cf8e5b7f002211.tar.gz meson-f9445300b3015308fd6a3e0305cf8e5b7f002211.tar.bz2 |
structured_sources: fix subdir handling
We currently don't handle subdirectories correctly in
structured_sources, which is problematic. To make this easier to handle
correctly, I've simply changed `structured_sources` to only use Files
and not strings as an implementation detail.
Diffstat (limited to 'mesonbuild/backend')
-rw-r--r-- | mesonbuild/backend/ninjabackend.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index fdd5cd3..691f844 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -1669,9 +1669,7 @@ class NinjaBackend(backends.Backend): root = Path(self.get_target_private_dir(target)) / 'structured' for path, files in target.structured_sources.sources.items(): for file in files: - if isinstance(file, (str, File)): - if isinstance(file, str): - file = File.from_absolute_file(file) + if isinstance(file, File): out = root / path / Path(file.fname).name orderdeps.append(str(out)) self._generate_copy_target(file, out) @@ -1707,13 +1705,11 @@ class NinjaBackend(backends.Backend): main_rust_file = None if target.structured_sources: - if target.structured_sources.needs_copy(target): + if target.structured_sources.needs_copy(): _ods, main_rust_file = self.__generate_compile_structure(target) orderdeps.extend(_ods) else: g = target.structured_sources.first_file() - if isinstance(g, str): - g = File.from_source_file(self.environment.source_dir, target.subdir, g) if isinstance(g, File): main_rust_file = g.rel_to_builddir(self.build_to_src) |