[v4,4/6] doc/guides: reduce whitespace in meson build file

Message ID 20200110215205.513185-5-bruce.richardson@intel.com (mailing list archive)
State Accepted, archived
Delegated to: David Marchand
Headers
Series meson build improvements |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Bruce Richardson Jan. 10, 2020, 9:52 p.m. UTC
  For building the guides, we can make the meson.build easier to read by
using the subdir_done function to quit early.

Cc: stable@dpdk.org

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Aaron Conole <aconole@redhat.com>
Acked-by: Luca Boccassi <bluca@debian.org>

---
@stable, this may be considered for 19.11 backport to make other
backporting to this file easier.
---
 doc/guides/meson.build | 44 ++++++++++++++++++++++--------------------
 1 file changed, 23 insertions(+), 21 deletions(-)
  

Patch

diff --git a/doc/guides/meson.build b/doc/guides/meson.build
index 7931ef3bb..80c21d168 100644
--- a/doc/guides/meson.build
+++ b/doc/guides/meson.build
@@ -3,26 +3,28 @@ 
 
 sphinx = find_program('sphinx-build', required: get_option('enable_docs'))
 
-if sphinx.found()
-	htmldir = join_paths('share', 'doc', 'dpdk')
-	html_guides_build = custom_target('html_guides_build',
-		input: meson.current_source_dir(),
-		output: 'guides',
-		command: [sphinx, '-b', 'html',
-			'-d', meson.current_build_dir() + '/.doctrees',
-			'@INPUT@', meson.current_build_dir() + '/guides'],
-		build_by_default: get_option('enable_docs'),
-		install: get_option('enable_docs'),
-		install_dir: htmldir)
+if not sphinx.found()
+	subdir_done()
+endif
 
-	doc_targets += html_guides_build
-	doc_target_names += 'HTML_Guides'
+htmldir = join_paths('share', 'doc', 'dpdk')
+html_guides = custom_target('html_guides',
+	input: meson.current_source_dir(),
+	output: 'guides',
+	command: [sphinx, '-b', 'html',
+		'-d', meson.current_build_dir() + '/.doctrees',
+		'@INPUT@', meson.current_build_dir() + '/guides'],
+	build_by_default: get_option('enable_docs'),
+	install: get_option('enable_docs'),
+	install_dir: htmldir)
 
-	# sphinx leaves a .buildinfo in the target directory, which we don't
-	# want to install. Note that sh -c has to be used, otherwise the
-	# env var does not get expanded if calling rm/install directly.
-	meson.add_install_script('sh', '-c',
-		'rm -f $MESON_INSTALL_DESTDIR_PREFIX/share/doc/dpdk/guides/.buildinfo')
-	meson.add_install_script('sh', '-c',
-		'install -D -m0644 $MESON_SOURCE_ROOT/doc/guides/custom.css $MESON_INSTALL_DESTDIR_PREFIX/share/doc/dpdk/guides/_static/css/custom.css')
-endif
+doc_targets += html_guides
+doc_target_names += 'HTML_Guides'
+
+# sphinx leaves a .buildinfo in the target directory, which we don't
+# want to install. Note that sh -c has to be used, otherwise the
+# env var does not get expanded if calling rm/install directly.
+meson.add_install_script('sh', '-c',
+	'rm -f $MESON_INSTALL_DESTDIR_PREFIX/share/doc/dpdk/guides/.buildinfo')
+meson.add_install_script('sh', '-c',
+	'install -D -m0644 $MESON_SOURCE_ROOT/doc/guides/custom.css $MESON_INSTALL_DESTDIR_PREFIX/share/doc/dpdk/guides/_static/css/custom.css')