All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mauro.chehab@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t v4 6/8] testplan/meson.build: cleanup dependency chain
Date: Wed, 22 Mar 2023 07:50:01 +0100	[thread overview]
Message-ID: <20230322065003.1758611-7-mauro.chehab@linux.intel.com> (raw)
In-Reply-To: <20230322065003.1758611-1-mauro.chehab@linux.intel.com>

From: Mauro Carvalho Chehab <mchehab@kernel.org>

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.

Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
---
 docs/meson.build          |  5 ++++-
 docs/testplan/meson.build | 42 +++++++++++++++++----------------------
 meson.build               |  3 +++
 scripts/meson.build       |  4 ++--
 4 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/docs/meson.build b/docs/meson.build
index 01edf64f04a8..d56260564cec 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 d34a8212df76..9e7ae7a04753 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())
diff --git a/meson.build b/meson.build
index 12d5113a9042..7360634fe199 100644
--- a/meson.build
+++ b/meson.build
@@ -328,6 +328,9 @@ else
 endif
 build_info += 'Build tests: @0@'.format(build_tests)
 
+build_testplan = get_option('testplan')
+build_sphinx = get_option('sphinx')
+
 subdir('benchmarks')
 subdir('tools')
 subdir('runner')
diff --git a/scripts/meson.build b/scripts/meson.build
index ce12aa02e946..98783222b6fc 100644
--- a/scripts/meson.build
+++ b/scripts/meson.build
@@ -12,5 +12,5 @@ if build_tests
 	endforeach
 endif
 
-igt_doc_script = find_program('igt_doc.py')
-gen_rst_index = find_program('gen_rst_index')
+igt_doc_script = find_program('igt_doc.py', required : build_testplan)
+gen_rst_index = find_program('gen_rst_index', required : build_sphinx)
-- 
2.39.2

  parent reply	other threads:[~2023-03-22  6:50 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-22  6:49 [igt-dev] [PATCH i-g-t v4 0/8] Build Xe test documentation Mauro Carvalho Chehab
2023-03-22  6:49 ` [igt-dev] [PATCH i-g-t v4 1/8] meson: build " Mauro Carvalho Chehab
2023-03-22  6:49 ` [igt-dev] [PATCH i-g-t v4 2/8] testplan: build also a PDF file with the testplan Mauro Carvalho Chehab
2023-03-22  6:49 ` [igt-dev] [PATCH i-g-t v4 3/8] meson.build: place gtk-doc dependencies check at the right place Mauro Carvalho Chehab
2023-03-22  6:49 ` [igt-dev] [PATCH i-g-t v4 4/8] meson: get rid of a future-deprecated warning Mauro Carvalho Chehab
2023-03-22  6:50 ` [igt-dev] [PATCH i-g-t v4 5/8] meson: get rid of tests/xe/meson.build Mauro Carvalho Chehab
2023-03-22  6:50 ` Mauro Carvalho Chehab [this message]
2023-03-22  6:50 ` [igt-dev] [PATCH i-g-t v4 7/8] testplan/meson.build: use join_paths() Mauro Carvalho Chehab
2023-03-22  6:50 ` [igt-dev] [PATCH i-g-t v4 8/8] testplan/meson.build: re-indent file Mauro Carvalho Chehab
2023-03-22  6:57 ` [igt-dev] ✗ GitLab.Pipeline: warning for Build Xe test documentation (rev3) Patchwork
2023-03-22  7:26 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
2023-03-22 10:31 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2023-03-22  8:28 [igt-dev] [PATCH i-g-t v4 0/8] Build Xe test documentation Mauro Carvalho Chehab
2023-03-22  8:28 ` [igt-dev] [PATCH i-g-t v4 6/8] testplan/meson.build: cleanup dependency chain Mauro Carvalho Chehab
2023-03-24 13:49   ` Kamil Konieczny

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230322065003.1758611-7-mauro.chehab@linux.intel.com \
    --to=mauro.chehab@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.