Bladeren bron

`project` knows it's base dir

default_compile_flags
vector-of-bool 5 jaren geleden
bovenliggende
commit
fe492f5abd
2 gewijzigde bestanden met toevoegingen van 7 en 3 verwijderingen
  1. +1
    -1
      src/dds/project.cpp
  2. +6
    -2
      src/dds/project.hpp

+ 1
- 1
src/dds/project.cpp Bestand weergeven

@@ -30,5 +30,5 @@ project project::from_directory(path_ref pf_dir_path) {
if (has_library_dirs(pf_dir_path)) {
main_lib = library::from_directory(pf_dir_path);
}
return project(std::move(main_lib), collect_submodules(pf_dir_path / "libs"));
return project(pf_dir_path, std::move(main_lib), collect_submodules(pf_dir_path / "libs"));
}

+ 6
- 2
src/dds/project.hpp Bestand weergeven

@@ -9,11 +9,13 @@
namespace dds {

class project {
fs::path _root;
std::optional<library> _main_lib;
std::vector<library> _submodules;

project(std::optional<library>&& ml, std::vector<library>&& mods)
: _main_lib(std::move(ml))
project(path_ref root, std::optional<library>&& ml, std::vector<library>&& mods)
: _root(root)
, _main_lib(std::move(ml))
, _submodules(std::move(mods)) {}

public:
@@ -25,6 +27,8 @@ public:
}
return nullptr;
}

path_ref root() const noexcept { return _root; }
};

} // namespace dds

Laden…
Annuleren
Opslaan