diff --git a/src/Build.h b/src/Build.h index b033992..0cd34cb 100644 --- a/src/Build.h +++ b/src/Build.h @@ -48,7 +48,7 @@ class Build: public ScopedDirective { void process_outputs(const File& file); void print(std::ostream& stream) const; - void collect_output_files(std::unordered_set& output_files) const {outputs.collect_output_files(output_files);} + void collect_output_files(std::unordered_set& output_files) const {outputs.collect_output_files(output_files);} private: const Rule* rule{}; diff --git a/src/Dependencies.cc b/src/Dependencies.cc index be02ca2..7b8bddd 100644 --- a/src/Dependencies.cc +++ b/src/Dependencies.cc @@ -111,7 +111,7 @@ void Dependencies::serialize(std::ostream& stream) const { } } -void Dependencies::collect_output_files(std::unordered_set& output_files) const { +void Dependencies::collect_output_files(std::unordered_set& output_files) const { direct.collect_output_files(output_files); implicit.collect_output_files(output_files); order.collect_output_files(output_files); diff --git a/src/Dependencies.h b/src/Dependencies.h index d2be434..3175c31 100644 --- a/src/Dependencies.h +++ b/src/Dependencies.h @@ -45,7 +45,7 @@ class Dependencies { Dependencies() = default; void resolve(const Scope& scope); - void collect_output_files(std::unordered_set& output_files) const; + void collect_output_files(std::unordered_set& output_files) const; void mark_as_build(); void serialize(std::ostream& stream) const; diff --git a/src/File.cc b/src/File.cc index 01ab9ba..7e1d4eb 100644 --- a/src/File.cc +++ b/src/File.cc @@ -59,7 +59,7 @@ File::File(const std::filesystem::path& filename, const std::filesystem::path& b void File::process() { auto bindings = Bindings{}; - bindings.add(std::shared_ptr(new TextVariable{ "command", Text{ std::vector{ Word{ "fast-ninja", false }, Word{ " ", false }, Word{ source_directory, true } } } })); + bindings.add(std::shared_ptr(new TextVariable{ "command", Text{ std::vector{ Word{ "fast-ninja", false }, Word{ " ", false }, Word{ source_directory.string(), true } } } })); bindings.add(std::shared_ptr(new TextVariable{ "generator", Text{ "1", false } })); rules["fast-ninja"] = Rule(this, "fast-ninja", bindings); diff --git a/src/File.h b/src/File.h index bbe1c19..c5e1151 100644 --- a/src/File.h +++ b/src/File.h @@ -53,7 +53,7 @@ class File: public Scope { explicit File(const std::filesystem::path& filename, const std::filesystem::path& build_directory = ".", const File* next = {}); void process(); - [[nodiscard]] bool is_output(const std::filesystem::path& file) const {return outputs.contains(file.lexically_normal());} + [[nodiscard]] bool is_output(const std::filesystem::path& file) const {return outputs.contains(file.lexically_normal().string());} [[nodiscard]] const Rule* find_rule(const std::string& name) const; [[nodiscard]] const Variable* find_variable(const std::string& name) const; @@ -82,7 +82,7 @@ class File: public Scope { std::filesystem::path source_filename; std::filesystem::path build_filename; - std::unordered_set outputs; + std::unordered_set outputs; std::set includes; std::map rules; std::map pools; diff --git a/src/FilenameList.cc b/src/FilenameList.cc index 6dce1c9..d36c4f8 100644 --- a/src/FilenameList.cc +++ b/src/FilenameList.cc @@ -115,10 +115,10 @@ std::ostream& operator<<(std::ostream& stream, const FilenameList& filename_list return stream; } -void FilenameList::collect_output_files(std::unordered_set& output_files) const { +void FilenameList::collect_output_files(std::unordered_set& output_files) const { for (auto& filename: filenames) { if (filename.type == Filename::Type::BUILD) { - output_files.insert(filename.full_name()); + output_files.insert(filename.full_name().string()); } } } diff --git a/src/FilenameList.h b/src/FilenameList.h index 91fd3bd..1174e1a 100644 --- a/src/FilenameList.h +++ b/src/FilenameList.h @@ -53,7 +53,7 @@ class FilenameList { [[nodiscard]] bool empty() const {return words.empty() && filenames.empty();} void serialize(std::ostream& stream) const; [[nodiscard]] std::string string() const; - void collect_output_files(std::unordered_set& output_files) const; + void collect_output_files(std::unordered_set& output_files) const; void collect_filenames(std::vector& collector) const {collector.insert(collector.end(), filenames.begin(), filenames.end());} diff --git a/src/FilenameWord.h b/src/FilenameWord.h index cf6e93a..442fdcc 100644 --- a/src/FilenameWord.h +++ b/src/FilenameWord.h @@ -35,6 +35,7 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "Filename.h" #include +#include #include "VariableReference.h"