From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8B029A046B; Thu, 9 Jan 2020 12:57:27 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5B4401DCC5; Thu, 9 Jan 2020 12:57:03 +0100 (CET) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 415561DC02 for ; Thu, 9 Jan 2020 12:57:02 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Jan 2020 03:57:01 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,413,1571727600"; d="scan'208";a="254571948" Received: from silpixa00399126.ir.intel.com (HELO silpixa00399126.ger.corp.intel.com) ([10.237.223.2]) by fmsmga002.fm.intel.com with ESMTP; 09 Jan 2020 03:56:59 -0800 From: Bruce Richardson To: david.marchand@6wind.com, john.mcnamara@intel.com, bluca@debian.org Cc: dev@dpdk.org, Bruce Richardson Date: Thu, 9 Jan 2020 11:56:31 +0000 Message-Id: <20200109115631.500056-7-bruce.richardson@intel.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200109115631.500056-1-bruce.richardson@intel.com> References: <20200109115631.500056-1-bruce.richardson@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 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 --- 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' -- 2.24.1