Re: [PATCH v2 3/4] meson: add support for 'hdr-check'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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]).

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).

--
Toon




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux