Toon Claes <toon@xxxxxxxxx> writes: > Karthik Nayak <karthik.188@xxxxxxxxx> writes: > >> The Makefile supports a target called 'hdr-check', which checks if >> individual header files can be independently compiled. Let's port this >> functionality to meson, our new build system too. The implementation >> resembles that of the Makefile and provides the same check. >> >> Signed-off-by: Karthik Nayak <karthik.188@xxxxxxxxx> >> --- >> meson.build | 107 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ >> 1 file changed, 107 insertions(+) >> >> diff --git a/meson.build b/meson.build >> index 790d178007..6fce1aa618 100644 >> --- a/meson.build >> +++ b/meson.build >> @@ -655,6 +655,12 @@ if git.found() >> endforeach >> endif >> >> +headers_generated = [ >> + 'command-list.h', >> + 'config-list.h', >> + 'hook-list.h' >> +] > > Can we maybe compose this list by instead doing: > > generated_headers = [] > foreach f : builtin_sources + libgit_sources + third_party_sources > if f.endswith(".h") > generated_headers += f > endif > endforeach > > (This would take `third_party_sources` into account as suggested by > Patrick[1]). > This does make sense, but this also feels like an overkill to only get three headers. > If we consider that too much magic, I would suggest: > > generated_headers = [] > builtin_sources += custom_target( > output: 'config-list.h', > command: [ > shell, > meson.current_source_dir() + '/generate-configlist.sh', > meson.current_source_dir(), > '@OUTPUT@', > ], > env: script_environment, > ) > generated_headers += 'config-list.h' > > I hope this would reduce the chance to forget to add more headers to > this list (assuming people copy the code blurb from another location). > This looks nice, Let me modify accordingly! > -- > Toon
Attachment:
signature.asc
Description: PGP signature