[igt-dev] [PATCH i-g-t] gtkdoc: Remove the build_by_default hack

Petri Latvala petri.latvala at intel.com
Wed Jun 20 09:59:46 UTC 2018


On Tue, Jun 19, 2018 at 08:47:37AM +0200, Daniel Vetter wrote:
> meson 0.45 properly supports generated content_files. Except for the
> minor issue that we're hitting an internal bug in meson. I've made a
> pull request for that
> 
> https://github.com/mesonbuild/meson/pull/3189
> 
> which has now been addressed in
> 
> commit c1f275bfa644beafab9f8572351d4b64d61c148b
> Author: Nirbheek Chauhan <nirbheek at centricular.com>
> Date:   Sun May 6 20:09:49 2018 +0530
> 
>     gnome.gtkdoc: Allow passing file objects as xml_files
> 
>     If we pass a source files() object, we will look for it in the build
>     directory, which is wrong. If we pass a build files() object (from
>     configure_file()), we will find it in the build directory, and then
>     try to copy it on top of itself in gtkdochelper.py getting a
>     SameFileError.
> 
>     Add a test for it, and also properly iterate custom target outputs
>     when adding to content files.
> 
> Downside of this all is that we'd need to up the meson requirements to
> something like 0.47, which isn't even released yet :-/
> 
> v2: Rebase and also add version requirement.
> 
> v3: I figured out how to make this work with a meson version check!
> 
> v4: Remove stray hunk (Petri).
> 
> Cc: Eric Anholt <eric at anholt.net>
> Signed-off-by: Daniel Vetter <daniel.vetter at intel.com>

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


> ---
>  docs/reference/igt-gpu-tools/meson.build | 49 ++++++++++++++++--------
>  1 file changed, 34 insertions(+), 15 deletions(-)
> 
> diff --git a/docs/reference/igt-gpu-tools/meson.build b/docs/reference/igt-gpu-tools/meson.build
> index aadb9af593d9..ebcb6b7a4874 100644
> --- a/docs/reference/igt-gpu-tools/meson.build
> +++ b/docs/reference/igt-gpu-tools/meson.build
> @@ -50,27 +50,46 @@ gen_programs = find_program('generate_programs_xml.sh')
>  
>  test_list_files = []
>  
> -foreach group : test_groups
> -	programs_xml = 'igt_test_programs_' + group + '_programs.xml'
> -	custom_target(programs_xml,
> -		      output : programs_xml,
> -		      build_by_default : true,
> -		      command : [ gen_programs, '@OUTPUT@', group, test_list ])
> -
> -	description_xml = 'igt_test_programs_' + group + '_description.xml'
> -	custom_target(description_xml,
> -		      output : description_xml,
> -		      build_by_default : true,
> -		      depends : test_executables,
> -		      command : [ gen_description, '@OUTPUT@', group, test_list ])
> -endforeach
> +generated_docs = []
>  
>  configure_file(input: 'version.xml.in',
>  	       output: 'version.xml',
>  	       install: false, configuration: config)
>  
> +if meson.version().version_compare('>= 0.47')
> +	foreach group : test_groups
> +		programs_xml = 'igt_test_programs_' + group + '_programs.xml'
> +		generated_docs += custom_target(programs_xml,
> +			      output : programs_xml,
> +			      command : [ gen_programs, '@OUTPUT@', group, test_list ])
> +
> +		description_xml = 'igt_test_programs_' + group + '_description.xml'
> +		generated_docs += custom_target(description_xml,
> +			      output : description_xml,
> +			      depends : test_executables,
> +			      command : [ gen_description, '@OUTPUT@', group, test_list ])
> +	endforeach
> +else
> +	# older meson needs the build_by_default hack because gtkdoc dependency
> +	# handling is broken
> +	foreach group : test_groups
> +		programs_xml = 'igt_test_programs_' + group + '_programs.xml'
> +		custom_target(programs_xml,
> +			      build_by_default : true,
> +			      output : programs_xml,
> +			      command : [ gen_programs, '@OUTPUT@', group, test_list ])
> +
> +		description_xml = 'igt_test_programs_' + group + '_description.xml'
> +		custom_target(description_xml,
> +			      build_by_default : true,
> +			      output : description_xml,
> +			      depends : test_executables,
> +			      command : [ gen_description, '@OUTPUT@', group, test_list ])
> +	endforeach
> +endif
> +
>  gnome.gtkdoc('igt-gpu-tools',
> -	     content_files : ['igt_test_programs.xml'],
> +	     content_files : ['igt_test_programs.xml'] + generated_docs,
>  	     dependencies : lib_igt,
>  	     install : true,
>  	     main_xml : 'igt-gpu-tools-docs.xml',
> -- 
> 2.17.0
> 
> _______________________________________________
> 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