From patchwork Thu Jan 9 12:07:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 64349 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id C2020A046B; Thu, 9 Jan 2020 13:08:18 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6CC111DCDD; Thu, 9 Jan 2020 13:08:14 +0100 (CET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id ACCC31DCC3 for ; Thu, 9 Jan 2020 13:08:11 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Jan 2020 04:08:11 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,413,1571727600"; d="scan'208";a="234741038" Received: from silpixa00399126.ir.intel.com (HELO silpixa00399126.ger.corp.intel.com) ([10.237.223.2]) by orsmga002.jf.intel.com with ESMTP; 09 Jan 2020 04:08:09 -0800 From: Bruce Richardson To: david.marchand@redhat.com, john.mcnamara@intel.com, bluca@debian.org Cc: dev@dpdk.org, aconole@redhat.com, thomas@monjalon.net, Bruce Richardson Date: Thu, 9 Jan 2020 12:07:56 +0000 Message-Id: <20200109120801.500394-2-bruce.richardson@intel.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200109120801.500394-1-bruce.richardson@intel.com> References: <20200109115631.500056-1-bruce.richardson@intel.com> <20200109120801.500394-1-bruce.richardson@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v2 1/6] kernel/linux/kni: fix meson warning about console keyword X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Since kni no longer includes the ethtool code and so is faster to build, we no longer need the console parameter to have incremental screen updates as it builds. Therefore, we drop the keyword which removes the warning. Fixes: b78f32cff94d ("kni: support meson build") Cc: bluca@debian.org Signed-off-by: Bruce Richardson Acked-by: Aaron Conole --- kernel/linux/kni/meson.build | 1 - 1 file changed, 1 deletion(-) diff --git a/kernel/linux/kni/meson.build b/kernel/linux/kni/meson.build index 955eec949..f93e97fa0 100644 --- a/kernel/linux/kni/meson.build +++ b/kernel/linux/kni/meson.build @@ -23,7 +23,6 @@ custom_target('rte_kni', ' -I' + meson.current_source_dir(), 'modules'], depends: kni_mkfile, - console: true, install: true, install_dir: kernel_dir + '/extra/dpdk', build_by_default: get_option('enable_kmods')) From patchwork Thu Jan 9 12:07:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 64350 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5D201A046B; Thu, 9 Jan 2020 13:08:26 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D5C051DCE7; Thu, 9 Jan 2020 13:08:15 +0100 (CET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 70C751DCDB for ; Thu, 9 Jan 2020 13:08:13 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Jan 2020 04:08:13 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,413,1571727600"; d="scan'208";a="234741115" Received: from silpixa00399126.ir.intel.com (HELO silpixa00399126.ger.corp.intel.com) ([10.237.223.2]) by orsmga002.jf.intel.com with ESMTP; 09 Jan 2020 04:08:11 -0800 From: Bruce Richardson To: david.marchand@redhat.com, john.mcnamara@intel.com, bluca@debian.org Cc: dev@dpdk.org, aconole@redhat.com, thomas@monjalon.net, Bruce Richardson Date: Thu, 9 Jan 2020 12:07:57 +0000 Message-Id: <20200109120801.500394-3-bruce.richardson@intel.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200109120801.500394-1-bruce.richardson@intel.com> References: <20200109115631.500056-1-bruce.richardson@intel.com> <20200109120801.500394-1-bruce.richardson@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v2 2/6] build: skip processing docs folder if docs disabled X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" While each target is set to be ignored if the docs are disabled in the meson build, there is little reason to process the docs folder at all. Signed-off-by: Bruce Richardson Acked-by: Aaron Conole --- doc/meson.build | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/meson.build b/doc/meson.build index c5410d85d..c49ec8476 100644 --- a/doc/meson.build +++ b/doc/meson.build @@ -1,6 +1,10 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2018 Luca Boccassi +if not get_option('enable_docs') + subdir_done() +endif + doc_targets = [] doc_target_names = [] subdir('api') From patchwork Thu Jan 9 12:07:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 64351 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id F37A5A046B; Thu, 9 Jan 2020 13:08:33 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3F35C1DCEC; Thu, 9 Jan 2020 13:08:17 +0100 (CET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id C63641DCE5 for ; Thu, 9 Jan 2020 13:08:15 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Jan 2020 04:08:15 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,413,1571727600"; d="scan'208";a="234741206" Received: from silpixa00399126.ir.intel.com (HELO silpixa00399126.ger.corp.intel.com) ([10.237.223.2]) by orsmga002.jf.intel.com with ESMTP; 09 Jan 2020 04:08:13 -0800 From: Bruce Richardson To: david.marchand@redhat.com, john.mcnamara@intel.com, bluca@debian.org Cc: dev@dpdk.org, aconole@redhat.com, thomas@monjalon.net, Bruce Richardson Date: Thu, 9 Jan 2020 12:07:58 +0000 Message-Id: <20200109120801.500394-4-bruce.richardson@intel.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200109120801.500394-1-bruce.richardson@intel.com> References: <20200109115631.500056-1-bruce.richardson@intel.com> <20200109120801.500394-1-bruce.richardson@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v2 3/6] doc/api: fix warning with meson build X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The install parameter to configure_file is new in 0.50 and generates a warning since it is newer than our minimum version of 0.47.1. The parameter, however, is unneeded as the documentation states: "When omitted it defaults to true when install_dir is set and not empty, false otherwise." Given that install_dir is not set for this file, install defaults to false so no need to explicitly specify it. Fixes: 720b14db3ae2 ("build: generate API documentation with meson") Cc: bluca@debian.org Signed-off-by: Bruce Richardson Acked-by: Aaron Conole --- doc/api/meson.build | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/api/meson.build b/doc/api/meson.build index 1c48b7672..23a7dfc75 100644 --- a/doc/api/meson.build +++ b/doc/api/meson.build @@ -38,8 +38,7 @@ if doxygen.found() doxy_conf = configure_file(input: 'doxy-api.conf.in', output: 'doxy-api.conf', - configuration: cdata, - install: false) + configuration: cdata) doxy_build = custom_target('doxygen', depends: example, From patchwork Thu Jan 9 12:07:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 64352 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7BB3AA046B; Thu, 9 Jan 2020 13:08:41 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9A2371DCF2; Thu, 9 Jan 2020 13:08:18 +0100 (CET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 6FDFA1DCF0 for ; Thu, 9 Jan 2020 13:08:17 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Jan 2020 04:08:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,413,1571727600"; d="scan'208";a="234741288" Received: from silpixa00399126.ir.intel.com (HELO silpixa00399126.ger.corp.intel.com) ([10.237.223.2]) by orsmga002.jf.intel.com with ESMTP; 09 Jan 2020 04:08:15 -0800 From: Bruce Richardson To: david.marchand@redhat.com, john.mcnamara@intel.com, bluca@debian.org Cc: dev@dpdk.org, aconole@redhat.com, thomas@monjalon.net, Bruce Richardson Date: Thu, 9 Jan 2020 12:07:59 +0000 Message-Id: <20200109120801.500394-5-bruce.richardson@intel.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200109120801.500394-1-bruce.richardson@intel.com> References: <20200109115631.500056-1-bruce.richardson@intel.com> <20200109120801.500394-1-bruce.richardson@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v2 4/6] doc/guides: reduce whitespace in meson build file X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" For building the guides, we can make the meson.build easier to read by using the subdir_done function to quit early. Signed-off-by: Bruce Richardson Acked-by: Aaron Conole --- doc/guides/meson.build | 44 ++++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 21 deletions(-) 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') From patchwork Thu Jan 9 12:08:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 64353 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 52272A046B; Thu, 9 Jan 2020 13:08:50 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2EC761DCF7; Thu, 9 Jan 2020 13:08:21 +0100 (CET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 6E9D31DCDB for ; Thu, 9 Jan 2020 13:08:19 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Jan 2020 04:08:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,413,1571727600"; d="scan'208";a="234741388" Received: from silpixa00399126.ir.intel.com (HELO silpixa00399126.ger.corp.intel.com) ([10.237.223.2]) by orsmga002.jf.intel.com with ESMTP; 09 Jan 2020 04:08:17 -0800 From: Bruce Richardson To: david.marchand@redhat.com, john.mcnamara@intel.com, bluca@debian.org Cc: dev@dpdk.org, aconole@redhat.com, thomas@monjalon.net, Bruce Richardson Date: Thu, 9 Jan 2020 12:08:00 +0000 Message-Id: <20200109120801.500394-6-bruce.richardson@intel.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200109120801.500394-1-bruce.richardson@intel.com> References: <20200109115631.500056-1-bruce.richardson@intel.com> <20200109120801.500394-1-bruce.richardson@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v2 5/6] doc/guides: rebuild with meson whenever a file changes X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Add proper support for calling sphinx whenever a file in the doc directory changes. This is accomplished by using a wrapper script for sphinx, which runs sphinx but also emits a gcc-format dependency file listing all the doc files. This is used by ninja so that any change to the doc files triggers a rebuild of the docs. Signed-off-by: Bruce Richardson Acked-by: Aaron Conole --- buildtools/call-sphinx-build.py | 29 +++++++++++++++++++++++++++++ buildtools/meson.build | 6 ++++-- doc/guides/meson.build | 22 ++++++++-------------- 3 files changed, 41 insertions(+), 16 deletions(-) create mode 100755 buildtools/call-sphinx-build.py diff --git a/buildtools/call-sphinx-build.py b/buildtools/call-sphinx-build.py new file mode 100755 index 000000000..027317b9b --- /dev/null +++ b/buildtools/call-sphinx-build.py @@ -0,0 +1,29 @@ +#! /usr/bin/env python3 +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2019 Intel Corporation +# + +import sys +import os +import os.path +import subprocess + +sphinx = sys.argv[1] +src = sys.argv[2] +dst = sys.argv[3] +depfile = os.path.join(dst,'.html.d') + +# find all the files sphinx will process so we can write them as dependencies +srcfiles = [] +for root, dirs, files in os.walk(src): + for f in files: + srcfiles.append(os.path.join(root, f)) + +# run sphinx, putting the html output in a "html" directory +subprocess.run([sphinx, '-j', 'auto', '-b', 'html', src, + os.path.join(dst, 'html')], check = True) + +# create a gcc format .d file giving all the dependencies of this doc build +with open(depfile, 'w') as d: + d.write('html: ' + ' '.join(srcfiles) + '\n') +subprocess.run(['cp', '-f', depfile, '/tmp']) diff --git a/buildtools/meson.build b/buildtools/meson.build index 6ef2c5721..cd1d05403 100644 --- a/buildtools/meson.build +++ b/buildtools/meson.build @@ -10,10 +10,12 @@ check_experimental_syms = find_program('check-experimental-syms.sh') # set up map-to-def script using python, either built-in or external python3 = import('python').find_installation(required: false) if python3.found() - map_to_def_cmd = [python3, files('map_to_def.py')] + py3 = [python3] else - map_to_def_cmd = ['meson', 'runpython', files('map_to_def.py')] + py3 = ['meson', 'runpython'] endif +map_to_def_cmd = py3 + files('map_to_def.py') +sphinx_wrapper = py3 + files('call-sphinx-build.py') # stable ABI always starts with "DPDK_" is_experimental_cmd = [find_program('grep', 'findstr'), '^DPDK_'] diff --git a/doc/guides/meson.build b/doc/guides/meson.build index 80c21d168..732e7ad3a 100644 --- a/doc/guides/meson.build +++ b/doc/guides/meson.build @@ -7,24 +7,18 @@ if not sphinx.found() subdir_done() endif -htmldir = join_paths('share', 'doc', 'dpdk') +htmldir = join_paths(get_option('datadir'), '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'], + input: files('index.rst'), + output: 'html', + command: [sphinx_wrapper, sphinx, meson.current_source_dir(), meson.current_build_dir()], + depfile: '.html.d', build_by_default: get_option('enable_docs'), install: get_option('enable_docs'), install_dir: htmldir) +install_data(files('custom.css'), + install_dir: join_paths(htmldir,'_static', 'css')) + 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') From patchwork Thu Jan 9 12:08:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 64354 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 57051A046B; Thu, 9 Jan 2020 13:08:59 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5B5881DCFD; Thu, 9 Jan 2020 13:08:23 +0100 (CET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id BAF751DCFD for ; Thu, 9 Jan 2020 13:08:21 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Jan 2020 04:08:21 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,413,1571727600"; d="scan'208";a="234741488" Received: from silpixa00399126.ir.intel.com (HELO silpixa00399126.ger.corp.intel.com) ([10.237.223.2]) by orsmga002.jf.intel.com with ESMTP; 09 Jan 2020 04:08:19 -0800 From: Bruce Richardson To: david.marchand@redhat.com, john.mcnamara@intel.com, bluca@debian.org Cc: dev@dpdk.org, aconole@redhat.com, thomas@monjalon.net, Bruce Richardson Date: Thu, 9 Jan 2020 12:08:01 +0000 Message-Id: <20200109120801.500394-7-bruce.richardson@intel.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200109120801.500394-1-bruce.richardson@intel.com> References: <20200109115631.500056-1-bruce.richardson@intel.com> <20200109120801.500394-1-bruce.richardson@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v2 6/6] doc/api: reduce indentation in meson build file X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" When building the API docs, we can make the meson.build file easier to read, and allow more code per line, by using subdir_done() to quit early. Signed-off-by: Bruce Richardson Acked-by: Aaron Conole --- doc/api/meson.build | 98 +++++++++++++++++++++++---------------------- 1 file changed, 50 insertions(+), 48 deletions(-) diff --git a/doc/api/meson.build b/doc/api/meson.build index 23a7dfc75..c72b880e1 100644 --- a/doc/api/meson.build +++ b/doc/api/meson.build @@ -3,52 +3,54 @@ doxygen = find_program('doxygen', required: get_option('enable_docs')) -if doxygen.found() - # due to the CSS customisation script, which needs to run on a file that - # is in a subdirectory that is created at build time and thus it cannot - # be an individual custom_target, we need to wrap the doxygen call in a - # script to run the CSS modification afterwards - generate_doxygen = find_program('generate_doxygen.sh') - generate_examples = find_program('generate_examples.sh') - generate_css = find_program('doxy-html-custom.sh') - - inputdir = join_paths(meson.source_root(), 'examples') - htmldir = join_paths('share', 'doc', 'dpdk') - - # due to the following bug: https://github.com/mesonbuild/meson/issues/4107 - # if install is set to true it will override build_by_default and it will - # cause the target to always be built. If install were to be always set to - # false it would be impossible to install the docs. - # So use a configure option for now. - example = custom_target('examples.dox', - input: inputdir, - output: 'examples.dox', - command: [generate_examples, '@INPUT@', '@OUTPUT@'], - install: get_option('enable_docs'), - install_dir: htmldir, - build_by_default: get_option('enable_docs')) - - cdata = configuration_data() - cdata.set('VERSION', meson.project_version()) - cdata.set('API_EXAMPLES', join_paths(meson.build_root(), 'doc', 'api', 'examples.dox')) - cdata.set('OUTPUT', join_paths(meson.build_root(), 'doc', 'api')) - cdata.set('HTML_OUTPUT', 'api') - cdata.set('TOPDIR', meson.source_root()) - cdata.set('STRIP_FROM_PATH', meson.source_root()) - - doxy_conf = configure_file(input: 'doxy-api.conf.in', - output: 'doxy-api.conf', - configuration: cdata) - - doxy_build = custom_target('doxygen', - depends: example, - input: doxy_conf, - output: 'api', - command: [generate_doxygen, '@INPUT@', '@OUTPUT@', generate_css], - install: get_option('enable_docs'), - install_dir: htmldir, - build_by_default: get_option('enable_docs')) - - doc_targets += doxy_build - doc_target_names += 'Doxygen_API' +if not doxygen.found() + subdir_done() endif + +# due to the CSS customisation script, which needs to run on a file that +# is in a subdirectory that is created at build time and thus it cannot +# be an individual custom_target, we need to wrap the doxygen call in a +# script to run the CSS modification afterwards +generate_doxygen = find_program('generate_doxygen.sh') +generate_examples = find_program('generate_examples.sh') +generate_css = find_program('doxy-html-custom.sh') + +inputdir = join_paths(meson.source_root(), 'examples') +htmldir = join_paths('share', 'doc', 'dpdk') + +# due to the following bug: https://github.com/mesonbuild/meson/issues/4107 +# if install is set to true it will override build_by_default and it will +# cause the target to always be built. If install were to be always set to +# false it would be impossible to install the docs. +# So use a configure option for now. +example = custom_target('examples.dox', + input: inputdir, + output: 'examples.dox', + command: [generate_examples, '@INPUT@', '@OUTPUT@'], + install: get_option('enable_docs'), + install_dir: htmldir, + build_by_default: get_option('enable_docs')) + +cdata = configuration_data() +cdata.set('VERSION', meson.project_version()) +cdata.set('API_EXAMPLES', join_paths(meson.build_root(), 'doc', 'api', 'examples.dox')) +cdata.set('OUTPUT', join_paths(meson.build_root(), 'doc', 'api')) +cdata.set('HTML_OUTPUT', 'api') +cdata.set('TOPDIR', meson.source_root()) +cdata.set('STRIP_FROM_PATH', meson.source_root()) + +doxy_conf = configure_file(input: 'doxy-api.conf.in', + output: 'doxy-api.conf', + configuration: cdata) + +doxy_build = custom_target('doxygen', + depends: example, + input: doxy_conf, + output: 'api', + command: [generate_doxygen, '@INPUT@', '@OUTPUT@', generate_css], + install: get_option('enable_docs'), + install_dir: htmldir, + build_by_default: get_option('enable_docs')) + +doc_targets += doxy_build +doc_target_names += 'Doxygen_API'