Initial MSVC build working

This commit is contained in:
Bartek Kryza
2023-01-06 23:39:56 +00:00
parent 476a7873f9
commit f5bcbeec0b
16 changed files with 106 additions and 42 deletions

View File

@@ -191,14 +191,17 @@ inja::json generator<C, D>::element_context(const E &e) const
if (!e.file().empty()) {
std::filesystem::path file{e.file()};
std::string relative_path = file.string();
#if _MSC_VER
if (file.is_absolute() && ctx.contains("git"))
#else
if (file.is_absolute() && ctx.template contains("git"))
#endif
relative_path =
std::filesystem::relative(file, ctx["git"]["toplevel"]);
std::filesystem::relative(file, ctx["git"]["toplevel"]).string();
ctx["element"]["source"]["path"] = relative_path;
ctx["element"]["source"]["full_path"] = file.string();
ctx["element"]["source"]["name"] = file.filename();
ctx["element"]["source"]["name"] = file.filename().string();
ctx["element"]["source"]["line"] = e.line();
}

View File

@@ -184,12 +184,12 @@ tvl::value_t namespace_filter::match(
auto namespace_starts_with_element_qualified_name =
nsit.starts_with(e.get_namespace());
auto result = element_full_name_starts_with_namespace |
auto result = element_full_name_starts_with_namespace ||
element_full_name_equals_pattern;
if (is_inclusive)
result =
result | namespace_starts_with_element_qualified_name;
result || namespace_starts_with_element_qualified_name;
return result;
});

View File

@@ -53,7 +53,7 @@ public:
explicit source_file(const std::filesystem::path &p)
{
set_path({p.parent_path().string()});
set_name(p.filename());
set_name(p.filename().string());
is_absolute_ = p.is_absolute();
set_id(common::to_id(p));
}

View File

@@ -103,7 +103,7 @@ protected:
private:
clang::SourceManager &source_manager_;
const clanguml::config::diagram &config_;
[[maybe_unused]] const clanguml::config::diagram &config_;
std::unique_ptr<comment::comment_visitor> comment_visitor_;
};