Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

[impellerc] speculative fix for include errors with impellerc shader lib #37939

Merged
merged 3 commits into from
Nov 29, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions impeller/compiler/switches.cc
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,14 @@ Switches::Switches(const fml::CommandLine& command_line)
// Note that the `include_dir_path` is already utf8 encoded, and so we
// mustn't attempt to double-convert it to utf8 lest multi-byte characters
// will become mangled.
auto cwd = Utf8FromPath(std::filesystem::current_path());
auto include_dir_absolute = std::filesystem::absolute(
std::filesystem::path(cwd) / include_dir_path);
std::filesystem::path include_dir_absolute;
if (std::filesystem::path(include_dir_path).is_absolute()) {
include_dir_absolute = std::filesystem::path(include_dir_path);
} else {
auto cwd = Utf8FromPath(std::filesystem::current_path());
include_dir_absolute = std::filesystem::absolute(
std::filesystem::path(cwd) / include_dir_path);
}

auto dir = std::make_shared<fml::UniqueFD>(fml::OpenDirectoryReadOnly(
*working_directory, include_dir_absolute.string().c_str()));
Expand Down