Ver código fonte

`library` also knows its base dir

default_compile_flags
vector-of-bool 5 anos atrás
pai
commit
fc356f8f68
2 arquivos alterados com 7 adições e 4 exclusões
  1. +2
    -2
      src/dds/library.cpp
  2. +5
    -2
      src/dds/library.hpp

+ 2
- 2
src/dds/library.cpp Ver arquivo

@@ -51,7 +51,7 @@ pf_info collect_pf_sources(path_ref path) {
library library::from_directory(path_ref lib_dir, std::string_view name) {
auto [sources, inc_dir, src_dir] = collect_pf_sources(lib_dir);

auto lib = library(name, std::move(sources));;
auto lib = library(lib_dir, name, std::move(sources));

if (fs::exists(inc_dir)) {
lib._pub_inc_dir = inc_dir;
@@ -59,7 +59,7 @@ library library::from_directory(path_ref lib_dir, std::string_view name) {
lib._priv_inc_dir = src_dir;
}
} else {
lib._pub_inc_dir = src_dir;
lib._pub_inc_dir = src_dir;
lib._priv_inc_dir = src_dir;
}


+ 5
- 2
src/dds/library.hpp Ver arquivo

@@ -13,13 +13,15 @@ struct library_ident {
};

class library {
fs::path _base_dir;
std::string _name;
source_list _sources;
fs::path _pub_inc_dir;
fs::path _priv_inc_dir;

library(std::string_view name, source_list&& src)
: _name(name)
library(path_ref dir, std::string_view name, source_list&& src)
: _base_dir(dir)
, _name(name)
, _sources(std::move(src)) {}

public:
@@ -28,6 +30,7 @@ public:
return from_directory(path, path.filename().string());
}

path_ref base_dir() const noexcept { return _base_dir; }
path_ref public_include_dir() const noexcept { return _pub_inc_dir; }
path_ref private_include_dir() const noexcept { return _priv_inc_dir; }


Carregando…
Cancelar
Salvar