Browse Source

Fix: Don't break paths to dependencies when the repo-dir is a relative path

default_compile_flags
vector-of-bool 4 years ago
parent
commit
66c2712ee4
2 changed files with 6 additions and 5 deletions
  1. +4
    -3
      src/dds/library/root.cpp
  2. +2
    -2
      tests/dds.py

+ 4
- 3
src/dds/library/root.cpp View File

} // namespace } // namespace


library_root library_root::from_directory(path_ref lib_dir) { library_root library_root::from_directory(path_ref lib_dir) {
assert(lib_dir.is_absolute());
auto sources = collect_pf_sources(lib_dir); auto sources = collect_pf_sources(lib_dir);


library_manifest man; library_manifest man;
std::vector<library_root> dds::collect_libraries(path_ref root) { std::vector<library_root> dds::collect_libraries(path_ref root) {
std::vector<library_root> ret; std::vector<library_root> ret;
if (has_library_dirs(root)) { if (has_library_dirs(root)) {
ret.emplace_back(library_root::from_directory(root));
ret.emplace_back(library_root::from_directory(fs::canonical(root)));
} }


auto pf_libs_dir = root / "libs"; auto pf_libs_dir = root / "libs";
fs::directory_iterator(pf_libs_dir) // fs::directory_iterator(pf_libs_dir) //
| ranges::views::filter(has_library_dirs) // | ranges::views::filter(has_library_dirs) //
| ranges::views::transform( | ranges::views::transform(
[&](auto p) { return library_root::from_directory(p); }));
[&](auto p) { return library_root::from_directory(fs::canonical(p)); }));
} }
return ret; return ret;
}
}

+ 2
- 2
tests/dds.py View File

'build', 'build',
f'--out={self.build_dir}', f'--out={self.build_dir}',
f'--toolchain={toolchain or self.default_builtin_toolchain}', f'--toolchain={toolchain or self.default_builtin_toolchain}',
f'--catalog={self.catalog_path}',
f'--repo-dir={self.repo_dir}',
f'--catalog={self.catalog_path.relative_to(self.source_root)}',
f'--repo-dir={self.repo_dir.relative_to(self.source_root)}',
['--no-tests'] if not tests else [], ['--no-tests'] if not tests else [],
['--no-apps'] if not apps else [], ['--no-apps'] if not apps else [],
['--no-warnings'] if not warnings else [], ['--no-warnings'] if not warnings else [],

Loading…
Cancel
Save