Fixed link generation in include diagrams for include directives

This commit is contained in:
Bartek Kryza
2022-04-12 23:36:26 +02:00
parent a2f82bc847
commit 1915bd85b1
3 changed files with 27 additions and 4 deletions

View File

@@ -64,7 +64,7 @@ void translation_unit_visitor::process_include_directive(
auto include_path = std::filesystem::path(include_directive.full_path());
// Make sure the include_path is absolute with respect to the
// Make sure the file_path is absolute with respect to the
// filesystem, and in normal form
if (include_path.is_relative()) {
include_path = ctx.config().base_directory() / include_path;
@@ -103,9 +103,10 @@ void translation_unit_visitor::process_include_directive(
ctx.get_current_file().value().add_relationship(
relationship{relationship_type, include_file.alias()});
include_file.set_file(std::filesystem::absolute(include_path)
.lexically_normal()
.string());
include_file.set_file(
std::filesystem::absolute(include_directive.full_path())
.lexically_normal()
.string());
include_file.set_line(0);
}
else {