Fixed building on MSVC (#287)

This commit is contained in:
Bartek Kryza
2024-06-10 20:09:13 +02:00
parent fa742a03c4
commit 4f9a09783f
4 changed files with 39 additions and 2 deletions

View File

@@ -83,8 +83,12 @@ void translation_unit_visitor::include_visitor::InclusionDirective(
assert(diagram().get(current_file_id.value()));
#if LLVM_VERSION_MAJOR > 14
if (!file.has_value())
return;
auto include_path = std::filesystem::path(file->getDir().getName().str());
#else
if (file == nullptr)
return;
auto include_path = std::filesystem::path(file->getDir()->getName().str());
#endif
include_path = include_path / file->getName().str();