Skip to content

Commit ecef133

Browse files
nicoADKaster
authored andcommitted
Meta: Only write first output file to depfile
There's no advantage to writing more than one file, and it lets the depfile work with older versions of ninja.
1 parent f9ad5a4 commit ecef133

File tree

1 file changed

+9
-11
lines changed
  • Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator

1 file changed

+9
-11
lines changed

Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/main.cpp

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -191,18 +191,16 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
191191
auto depfile = TRY(Core::File::open_file_or_standard_stream(depfile_path, Core::File::OpenMode::Write));
192192

193193
StringBuilder depfile_builder;
194-
bool first_file = true;
195194
for (StringView s : { constructor_header, constructor_implementation, prototype_header, prototype_implementation, namespace_header, namespace_implementation, iterator_prototype_header, iterator_prototype_implementation, global_mixin_header, global_mixin_implementation }) {
196-
if (!s.is_empty()) {
197-
if (!first_file) {
198-
depfile_builder.append(' ');
199-
}
200-
if (!depfile_prefix.is_empty())
201-
depfile_builder.append(LexicalPath::join(depfile_prefix, s).string());
202-
else
203-
depfile_builder.append(s);
204-
first_file = false;
205-
}
195+
if (s.is_empty())
196+
continue;
197+
198+
if (!depfile_prefix.is_empty())
199+
depfile_builder.append(LexicalPath::join(depfile_prefix, s).string());
200+
else
201+
depfile_builder.append(s);
202+
203+
break;
206204
}
207205
depfile_builder.append(':');
208206
for (auto const& path : parser.imported_files()) {

0 commit comments

Comments
 (0)