[Mesa-dev] [PATCH 4/5] meson: convert gtest to an internal dependency

Dylan Baker dylan at pnwbakers.com
Mon Oct 2 16:45:05 UTC 2017


Quoting Eric Engestrom (2017-10-02 08:33:14)
> On Sunday, 2017-10-01 03:58:27 +0000, Dylan Baker wrote:
> > In truth gtest is an external dependency that upstream expects you to
> > "vendor" into your own tree. As such, it makes sense to treat it more
> > like a dependency than an internal library, and collect it's
> > requirements together in a dependency object.
> > 
> > Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
> > ---
> >  src/compiler/nir/meson.build             | 4 ++--
> >  src/gtest/meson.build                    | 6 ++++++
> >  src/intel/compiler/meson.build           | 6 +++---
> >  src/util/tests/string_buffer/meson.build | 4 ++--
> >  4 files changed, 13 insertions(+), 7 deletions(-)
> > 
> > diff --git a/src/compiler/nir/meson.build b/src/compiler/nir/meson.build
> > index c260dca5467..8a85d119530 100644
> > --- a/src/compiler/nir/meson.build
> > +++ b/src/compiler/nir/meson.build
> > @@ -197,8 +197,8 @@ if with_tests
> >      [files('tests/control_flow_tests.cpp'), nir_opcodes_h],
> >      c_args : [c_vis_args, c_msvc_compat_args, no_override_init_args],
> >      include_directories : [inc_common],
> > -    dependencies : [dep_thread],
> > -    link_with : [libmesa_util, libnir, libgtest],
> > +    dependencies : [dep_thread, idep_gtest],
> > +    link_with : [libmesa_util, libnir],
> >    )
> >  
> >    test('nir_control_flow', nir_control_flow_test)
> > diff --git a/src/gtest/meson.build b/src/gtest/meson.build
> > index b51504d400a..9832af93e25 100644
> > --- a/src/gtest/meson.build
> > +++ b/src/gtest/meson.build
> > @@ -24,3 +24,9 @@ libgtest = static_library(
> >    include_directories : include_directories('include'),
> >    build_by_default : false,
> >  )
> > +
> > +idep_gtest = declare_dependency(
> > +  link_with : libgtest,
> > +  include_directories : include_directories('include'),
> > +  compile_args : ['-Wno-sign-compare'],
> 
> Does meson not support/provide -isystem? This might be something to ask for.

There's an open bug for it: https://github.com/mesonbuild/meson/issues/963

When I get some time I'll look at it and see if I can get something working.

> 
> > +)
> > diff --git a/src/intel/compiler/meson.build b/src/intel/compiler/meson.build
> > index e12fa22cf1b..41c2f6ef1db 100644
> > --- a/src/intel/compiler/meson.build
> > +++ b/src/intel/compiler/meson.build
> > @@ -146,9 +146,9 @@ if with_tests
> >        [t, nir_opcodes_h, ir_expression_operation_h],
> >        'test_ at 0@.cpp'.format(t),
> >        include_directories : [inc_common, inc_intel],
> > -      link_with : [libgtest, libintel_compiler, libintel_common, libnir,
> > -                   libmesa_util, libisl],
> > -      dependencies : [dep_thread, dep_dl],
> > +      link_with : [libintel_compiler, libintel_common, libnir, libmesa_util,
> > +                   libisl],
> > +      dependencies : [dep_thread, dep_dl, idep_gtest],
> >      )
> >      test(t, _exe)
> >    endforeach
> > diff --git a/src/util/tests/string_buffer/meson.build b/src/util/tests/string_buffer/meson.build
> > index ea9b8a07dce..14dbebca7d8 100644
> > --- a/src/util/tests/string_buffer/meson.build
> > +++ b/src/util/tests/string_buffer/meson.build
> > @@ -21,9 +21,9 @@
> >  string_buffer_test = executable(
> >    'string_buffer_test',
> >    'string_buffer_test.cpp',
> > -  dependencies : [dep_thread, dep_dl],
> > +  dependencies : [dep_thread, dep_dl, idep_gtest],
> >    include_directories : inc_common,
> > -  link_with : [libmesa_util, libgtest],
> > +  link_with : [libmesa_util],
> >  )
> >  
> >  test('string_buffer', string_buffer_test)
> > -- 
> > 2.14.1
> > 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: signature
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20171002/13e6eab0/attachment.sig>


More information about the mesa-dev mailing list