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

Commit 0efb0ef

Browse files
authored
[ImpellerC] Print the working directory that was tried when failing to open (#38079)
* Resolve language before working directory, print the working directory that was tried * Quotes
1 parent 53d66aa commit 0efb0ef

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

impeller/compiler/switches.cc

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,6 @@ Switches::Switches(const fml::CommandLine& command_line)
130130
"0"))),
131131
entry_point(
132132
command_line.GetOptionValueWithDefault("entry-point", "main")) {
133-
if (!working_directory || !working_directory->is_valid()) {
134-
return;
135-
}
136-
137133
auto language =
138134
command_line.GetOptionValueWithDefault("source-language", "glsl");
139135
std::transform(language.begin(), language.end(), language.begin(),
@@ -144,6 +140,10 @@ Switches::Switches(const fml::CommandLine& command_line)
144140
source_language = SourceLanguage::kHLSL;
145141
}
146142

143+
if (!working_directory || !working_directory->is_valid()) {
144+
return;
145+
}
146+
147147
for (const auto& include_dir_path : command_line.GetOptionValues("include")) {
148148
if (!include_dir_path.data()) {
149149
continue;
@@ -196,7 +196,9 @@ bool Switches::AreValid(std::ostream& explain) const {
196196
}
197197

198198
if (!working_directory || !working_directory->is_valid()) {
199-
explain << "Could not figure out working directory." << std::endl;
199+
explain << "Could not open the working directory: \""
200+
<< Utf8FromPath(std::filesystem::current_path()).c_str() << "\""
201+
<< std::endl;
200202
valid = false;
201203
}
202204

0 commit comments

Comments
 (0)