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

Commit 9fbd5bf

Browse files
author
Jonah Williams
authored
[impellerc] speculative fix for include errors with impellerc shader lib (#37939)
* [impellerc] specualtive fix for include errors * ++ * ++
1 parent cc2f55d commit 9fbd5bf

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

impeller/compiler/switches.cc

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,9 +156,14 @@ Switches::Switches(const fml::CommandLine& command_line)
156156
// Note that the `include_dir_path` is already utf8 encoded, and so we
157157
// mustn't attempt to double-convert it to utf8 lest multi-byte characters
158158
// will become mangled.
159-
auto cwd = Utf8FromPath(std::filesystem::current_path());
160-
auto include_dir_absolute = std::filesystem::absolute(
161-
std::filesystem::path(cwd) / include_dir_path);
159+
std::filesystem::path include_dir_absolute;
160+
if (std::filesystem::path(include_dir_path).is_absolute()) {
161+
include_dir_absolute = std::filesystem::path(include_dir_path);
162+
} else {
163+
auto cwd = Utf8FromPath(std::filesystem::current_path());
164+
include_dir_absolute = std::filesystem::absolute(
165+
std::filesystem::path(cwd) / include_dir_path);
166+
}
162167

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

0 commit comments

Comments
 (0)