From patchwork Thu Jan 9 15:31:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bruce Richardson X-Patchwork-Id: 64377 X-Patchwork-Delegate: david.marchand@redhat.com 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 07B1FA046B; Thu, 9 Jan 2020 16:32:38 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0F62A1DED1; Thu, 9 Jan 2020 16:31:52 +0100 (CET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 2CE5A1DECE for ; Thu, 9 Jan 2020 16:31:50 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Jan 2020 07:31:49 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,414,1571727600"; d="scan'208";a="216333167" Received: from silpixa00399126.ir.intel.com (HELO silpixa00399126.ger.corp.intel.com) ([10.237.223.2]) by orsmga008.jf.intel.com with ESMTP; 09 Jan 2020 07:31:48 -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 15:31:12 +0000 Message-Id: <20200109153112.501282-7-bruce.richardson@intel.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200109153112.501282-1-bruce.richardson@intel.com> References: <20200109115631.500056-1-bruce.richardson@intel.com> <20200109153112.501282-1-bruce.richardson@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v3 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'