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

[ImpellerC] Print the working directory that was tried when failing to open #38079

Merged
merged 2 commits into from
Dec 5, 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
12 changes: 7 additions & 5 deletions impeller/compiler/switches.cc
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,6 @@ Switches::Switches(const fml::CommandLine& command_line)
"0"))),
entry_point(
command_line.GetOptionValueWithDefault("entry-point", "main")) {
if (!working_directory || !working_directory->is_valid()) {
return;
}

auto language =
command_line.GetOptionValueWithDefault("source-language", "glsl");
std::transform(language.begin(), language.end(), language.begin(),
Expand All @@ -144,6 +140,10 @@ Switches::Switches(const fml::CommandLine& command_line)
source_language = SourceLanguage::kHLSL;
}

if (!working_directory || !working_directory->is_valid()) {
return;
}

for (const auto& include_dir_path : command_line.GetOptionValues("include")) {
if (!include_dir_path.data()) {
continue;
Expand Down Expand Up @@ -196,7 +196,9 @@ bool Switches::AreValid(std::ostream& explain) const {
}

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

Expand Down