Sfoglia il codice sorgente

`project` knows it's base dir

default_compile_flags
vector-of-bool 5 anni fa
parent
commit
fe492f5abd
2 ha cambiato i file con 7 aggiunte e 3 eliminazioni
  1. +1
    -1
      src/dds/project.cpp
  2. +6
    -2
      src/dds/project.hpp

+ 1
- 1
src/dds/project.cpp Vedi File

@@ -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 Vedi File

@@ -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

Loading…
Annulla
Salva