From 9d8eea3e37cf27ed34568797da569849fb3c6a3a Mon Sep 17 00:00:00 2001 From: Brandon DeRosier Date: Mon, 5 Dec 2022 12:01:25 -0800 Subject: [PATCH 1/2] Resolve language before working directory, print the working directory that was tried --- impeller/compiler/switches.cc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/impeller/compiler/switches.cc b/impeller/compiler/switches.cc index 7618b0ed0ad73..5f6465d053111 100644 --- a/impeller/compiler/switches.cc +++ b/impeller/compiler/switches.cc @@ -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(), @@ -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; @@ -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; } From e598341f7eb29b40ebfb4e6089675bd57d7add31 Mon Sep 17 00:00:00 2001 From: Brandon DeRosier Date: Mon, 5 Dec 2022 12:09:42 -0800 Subject: [PATCH 2/2] Quotes --- impeller/compiler/switches.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/impeller/compiler/switches.cc b/impeller/compiler/switches.cc index 5f6465d053111..17bc358ac3f09 100644 --- a/impeller/compiler/switches.cc +++ b/impeller/compiler/switches.cc @@ -196,8 +196,8 @@ bool Switches::AreValid(std::ostream& explain) const { } if (!working_directory || !working_directory->is_valid()) { - explain << "Could not open the working directory: " - << Utf8FromPath(std::filesystem::current_path()).c_str() + explain << "Could not open the working directory: \"" + << Utf8FromPath(std::filesystem::current_path()).c_str() << "\"" << std::endl; valid = false; }