[igt-dev] [PATCH i-g-t 1/2] meson: Use bufmgr stubs headers if libdrm_intel is not found

Petri Latvala petri.latvala at intel.com
Tue Feb 20 10:19:50 UTC 2018


On Tue, Feb 20, 2018 at 11:00:21AM +0200, Arkadiusz Hiler wrote:
> Just adding the .h file to lib_headers is not enough.
> 
> We have to pass 'stubs/drm' as a part of include_directories when
> building, so a proper -I will be issued to the compiler. This can be
> done by turning 'inc' into a list of include_directories()-generated
> objects.
> 
> Cc: Liviu Dudau <liviu.dudau at arm.com>
> Cc: Eric Anholt <eric at anholt.net>
> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler at intel.com>
> ---
>  lib/meson.build | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/lib/meson.build b/lib/meson.build
> index 94ea0799..04b4fff6 100644
> --- a/lib/meson.build
> +++ b/lib/meson.build
> @@ -121,6 +121,7 @@ if libdrm_intel.found()
>  else
>  	lib_headers += 'stubs/drm/intel_bufmgr.h'
>  	lib_sources += 'stubs/drm/intel_bufmgr.c'
> +	inc = [ inc, include_directories('stubs/drm') ]
>  endif


Took me a while to follow meson magickry to see why this even works.

lib_igt depends on lib_igt_build which depends on all the intermediary
libraries for lib sources, and those have include_directories :
inc. Depending on lib_igt will then inherit the include_directories
directive.

We don't seem to be using lib_headers at all after
1f53e0dcec7aae3c48f4ef2ca63af66a36f5c29f, we could maybe get rid of
it.

The commit message is partly lying, include_directories is not
necessary for proper -I flags. The other way would be to use the
header files as the executable/lib's sources, but that would have been
uglier. Requires the use of files() in lib/meson.build, and adding the
resulting object to everything we build.

Reviewed-by: Petri Latvala <petri.latvala at intel.com>
Tested-by: Petri Latvala <petri.latvala at intel.com>


>  
>  if valgrind.found()
> -- 
> 2.14.3
> 
> _______________________________________________
> igt-dev mailing list
> igt-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev


More information about the igt-dev mailing list