Skip to content

Commit

Permalink
Fix compile issues from GitHub CI.
Browse files Browse the repository at this point in the history
  • Loading branch information
dillof committed Apr 16, 2024
1 parent e12dfb3 commit a023b9a
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/Build.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::filesystem::path>& output_files) const {outputs.collect_output_files(output_files);}
void collect_output_files(std::unordered_set<std::string>& output_files) const {outputs.collect_output_files(output_files);}

private:
const Rule* rule{};
Expand Down
2 changes: 1 addition & 1 deletion src/Dependencies.cc
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ void Dependencies::serialize(std::ostream& stream) const {
}
}

void Dependencies::collect_output_files(std::unordered_set<std::filesystem::path>& output_files) const {
void Dependencies::collect_output_files(std::unordered_set<std::string>& output_files) const {
direct.collect_output_files(output_files);
implicit.collect_output_files(output_files);
order.collect_output_files(output_files);
Expand Down
2 changes: 1 addition & 1 deletion src/Dependencies.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class Dependencies {
Dependencies() = default;

void resolve(const Scope& scope);
void collect_output_files(std::unordered_set<std::filesystem::path>& output_files) const;
void collect_output_files(std::unordered_set<std::string>& output_files) const;
void mark_as_build();
void serialize(std::ostream& stream) const;

Expand Down
2 changes: 1 addition & 1 deletion src/File.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<Variable>(new TextVariable{ "command", Text{ std::vector<Word>{ Word{ "fast-ninja", false }, Word{ " ", false }, Word{ source_directory, true } } } }));
bindings.add(std::shared_ptr<Variable>(new TextVariable{ "command", Text{ std::vector<Word>{ Word{ "fast-ninja", false }, Word{ " ", false }, Word{ source_directory.string(), true } } } }));
bindings.add(std::shared_ptr<Variable>(new TextVariable{ "generator", Text{ "1", false } }));

rules["fast-ninja"] = Rule(this, "fast-ninja", bindings);
Expand Down
4 changes: 2 additions & 2 deletions src/File.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -82,7 +82,7 @@ class File: public Scope {
std::filesystem::path source_filename;
std::filesystem::path build_filename;

std::unordered_set<std::filesystem::path> outputs;
std::unordered_set<std::string> outputs;
std::set<std::string> includes;
std::map<std::string, Rule> rules;
std::map<std::string, Pool> pools;
Expand Down
4 changes: 2 additions & 2 deletions src/FilenameList.cc
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,10 @@ std::ostream& operator<<(std::ostream& stream, const FilenameList& filename_list
return stream;
}

void FilenameList::collect_output_files(std::unordered_set<std::filesystem::path>& output_files) const {
void FilenameList::collect_output_files(std::unordered_set<std::string>& 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());
}
}
}
2 changes: 1 addition & 1 deletion src/FilenameList.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::filesystem::path>& output_files) const;
void collect_output_files(std::unordered_set<std::string>& output_files) const;

void collect_filenames(std::vector<Filename>& collector) const {collector.insert(collector.end(), filenames.begin(), filenames.end());}

Expand Down
1 change: 1 addition & 0 deletions src/FilenameWord.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "Filename.h"

#include <variant>
#include <vector>

#include "VariableReference.h"

Expand Down

0 comments on commit a023b9a

Please sign in to comment.