diff options
author | Mauro Carvalho Chehab <mchehab@kernel.org> | 2023-03-21 09:38:10 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@kernel.org> | 2023-03-24 15:37:05 +0100 |
commit | a78559965c341d1d23a77837a1e0b70786aeb4c3 (patch) | |
tree | 5d8755cd1396e9f9a7dd10060e5c4ef6a937a1ec /docs | |
parent | beaef4f26a249ad119ab1ff5abbe8c30df5795fa (diff) |
testplan/meson.build: cleanup dependency chain
Simplify the checks inside testplan/meson.build and ensure that
it will only build if option build_testplan is selected, by moving
such check to docs/meson.build.
Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'docs')
-rw-r--r-- | docs/meson.build | 5 | ||||
-rw-r--r-- | docs/testplan/meson.build | 42 |
2 files changed, 22 insertions, 25 deletions
diff --git a/docs/meson.build b/docs/meson.build index 01edf64f0..d56260564 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -1,2 +1,5 @@ subdir('reference') -subdir('testplan') + +if igt_doc_script.found() + subdir('testplan') +endif diff --git a/docs/testplan/meson.build b/docs/testplan/meson.build index d34a8212d..9e7ae7a04 100644 --- a/docs/testplan/meson.build +++ b/docs/testplan/meson.build @@ -1,10 +1,7 @@ testplan_title = 'IGT test plans' -build_testplan = get_option('testplan') -build_sphinx = get_option('sphinx') - -rst2html = find_program('rst2html-3', 'rst2html', required : build_testplan) sphinx = find_program('sphinx-build', required: build_sphinx) +rst2html = find_program('rst2html-3', 'rst2html', required : false) rst2pdf = find_program('rst2pdf', required: false) stylesheet = meson.current_source_dir() + '/testplan.css' @@ -20,26 +17,24 @@ test_dict = { 'xe_tests': { } } -if igt_doc_script.found() - foreach testplan, fields: test_dict - rst = custom_target(testplan + '.rst', - build_by_default : true, - command : [ igt_doc_script, '--config', '@INPUT@', '--rest', '@OUTPUT@' ] + fields['extra_args'], - depends : test_executables, - input : fields['input'], - output : testplan + '.rst' - ) +foreach testplan, fields: test_dict + rst = custom_target(testplan + '.rst', + build_by_default : true, + command : [ igt_doc_script, '--config', '@INPUT@', '--rest', '@OUTPUT@' ] + fields['extra_args'], + depends : test_executables, + input : fields['input'], + output : testplan + '.rst' + ) - if rst2html.found() - custom_target(testplan + '.html', - build_by_default : true, - command : [ rst2html, '--stylesheet=' + stylesheet, '--field-name-limit=0', '@INPUT@', '@OUTPUT@' ], - input : rst, - output : testplan + '.html' - ) - endif - endforeach -endif + if rst2html.found() + custom_target(testplan + '.html', + build_by_default : true, + command : [ rst2html, '--stylesheet=' + stylesheet, '--field-name-limit=0', '@INPUT@', '@OUTPUT@' ], + input : rst, + output : testplan + '.html' + ) + endif +endforeach if sphinx.found() if gen_rst_index.found() @@ -75,7 +70,6 @@ if sphinx.found() endif endif -build_info += 'Build ReST test documentation: @0@'.format(igt_doc_script.found()) build_info += 'Build simple html testplan documentation: @0@'.format(rst2html.found()) build_info += 'Build indexed html testplan documentation: @0@'.format(sphinx.found()) build_info += 'Build pdf testplan documentation: @0@'.format(sphinx.found() and rst2pdf.found()) |