[Mesa-dev] [Mesa-stable] [PATCH mesa 1/4] meson: turn git_sha1.h target into a proper dependency

Dylan Baker dylan at pnwbakers.com
Fri Oct 26 21:29:36 UTC 2018


Quoting Eric Engestrom (2018-10-26 14:05:31)
> On Friday, 2018-10-26 08:55:46 -0700, Dylan Baker wrote:
> > Quoting Eric Engestrom (2018-10-25 09:44:14)
> > > On Tuesday, 2018-10-02 13:44:07 -0700, Dylan Baker wrote:
> > > > Quoting Eric Engestrom (2018-10-02 07:09:03)
> > > > > Cc: mesa-stable at lists.freedesktop.org
> > > > > Signed-off-by: Eric Engestrom <eric.engestrom at intel.com>
> > > > > ---
> > > > >  src/mesa/meson.build |  3 +--
> > > > >  src/meson.build      | 13 ++++++++-----
> > > > >  2 files changed, 9 insertions(+), 7 deletions(-)
> > > > > 
> > > > > diff --git a/src/mesa/meson.build b/src/mesa/meson.build
> > > > > index ea884977db8052d86fcb..861b0311048eff422b9f 100644
> > > > > --- a/src/mesa/meson.build
> > > > > +++ b/src/mesa/meson.build
> > > > > @@ -705,7 +705,6 @@ files_libmesa_common += [
> > > > >    ir_expression_operation_h,
> > > > >    main_remap_helper_h,
> > > > >    matypes_h,
> > > > > -  sha1_h,
> > > > >  ]
> > > > >  
> > > > >  if with_sse41
> > > > > @@ -726,7 +725,7 @@ libmesa_classic = static_library(
> > > > >    cpp_args : [cpp_vis_args, cpp_msvc_compat_args],
> > > > >    include_directories : [inc_common, inc_libmesa_asm, include_directories('main')],
> > > > >    link_with : [libglsl, libmesa_sse41],
> > > > > -  dependencies : idep_nir_headers,
> > > > > +  dependencies : [idep_nir_headers, idep_git_sha1],
> > > > >    build_by_default : false,
> > > > >  )
> > > > >  
> > > > > diff --git a/src/meson.build b/src/meson.build
> > > > > index af881cff70bf752a6474..89ffaddf47b7286e4fe0 100644
> > > > > --- a/src/meson.build
> > > > > +++ b/src/meson.build
> > > > > @@ -39,11 +39,14 @@ libglsl_util = static_library(
> > > > >    build_by_default : false,
> > > > >  )
> > > > >  
> > > > > -sha1_h = custom_target(
> > > > > -  'git_sha1.h',
> > > > > -  output : 'git_sha1.h',
> > > > > -  command : [prog_python, git_sha1_gen_py, '--output', '@OUTPUT@'],
> > > > > -  build_always : true, # commit sha1 can change without having touched these files
> > > > > +idep_git_sha1 = declare_dependency(
> > > > > +  sources : custom_target(
> > > > > +    'git_sha1.h',
> > > > > +    output : 'git_sha1.h',
> > > > > +    command : [prog_python, git_sha1_gen_py, '--output', '@OUTPUT@'],
> > > > > +    build_always : true, # commit sha1 can change without having touched these files
> > > > > +  ),
> > > > > +  include_directories : inc_src,
> > > > 
> > > > What does this get us over including it in the source list, since it's a .h
> > > > meson should generate the proper include paths already, right?
> > > 
> > > Are you sure it does? I'll respin if that's really guaranteed and not
> > > just a coincidence :)
> > 
> > It does add git_sha1.h to the dependency list, but there is no guarantee that it
> > will in the documentation, I'll go update that. I'm not sure wrapping it in a
> > dependency changes that however, since all `sources` does is append a list
> > sources in the target, so it doesn't really change anything.
> 
> This wasn't really about the dependency tracking, my declare_dependency()
> change was to make sure the include path was guaranteed to be passed to
> the file containing `#include "git_sha1.h"`.

Then yes, putting a custom_target that is a header in the source list guarantees
that a -I argument will be generated.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: signature
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20181026/8dc76327/attachment-0001.sig>


More information about the mesa-dev mailing list