1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:07:35 +00:00

BindingsGenerator+CMake: Keep track of IDL dependencies

This commit teaches BindingsGenerator to generate depfiles, which can be
used by CMake to ensure that bindings are properly regenerated when
imported IDL files change.

Two new options, `--depfile` and `--depfile-target` are added.
- `--depfile` sets the path for the dependency file.
- `--depfile-target` lets us set a target name different than the output
  file in the depfile. This option is needed because generated files are
  first written to a temporary file, but depfiles have to refer to the
  final location.
These are analogous to GCC's `-MF` and `-MT` options respectively. The
depfile's syntax matches the ones generated by GCC.

Note: This changes the minimal required CMake version to 3.20 if the
Make generator is used, and to 3.21 for the Xcode generator. Ninja is
not affected.
This commit is contained in:
Daniel Bertalan 2022-11-05 11:37:33 +01:00 committed by Andreas Kling
parent 8d1ad592a1
commit 24d2c90a28
5 changed files with 44 additions and 2 deletions

View file

@ -1068,4 +1068,8 @@ HashTable<NonnullOwnPtr<Interface>>& Parser::top_level_interfaces()
return top_level_parser()->interfaces;
}
Vector<DeprecatedString> Parser::imported_files() const
{
return const_cast<Parser*>(this)->top_level_resolved_imports().keys();
}
}