From mboxrd@z Thu Jan 1 00:00:00 1970 From: Luca Boccassi Subject: Re: [PATCH] doc: support building HTML guides with meson Date: Tue, 11 Sep 2018 21:36:08 +0100 Message-ID: <1536698168.10952.34.camel@debian.org> References: <20180911161322.20114-1-bruce.richardson@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Cc: dev@dpdk.org To: Bruce Richardson Return-path: Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com [74.125.82.67]) by dpdk.org (Postfix) with ESMTP id 76E142BF9 for ; Tue, 11 Sep 2018 22:36:11 +0200 (CEST) Received: by mail-wm0-f67.google.com with SMTP id t25-v6so36746wmi.3 for ; Tue, 11 Sep 2018 13:36:11 -0700 (PDT) In-Reply-To: <20180911161322.20114-1-bruce.richardson@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Tue, 2018-09-11 at 17:13 +0100, Bruce Richardson wrote: > Signed-off-by: Bruce Richardson > --- > NOTE: this patch depends upon: > http://patches.dpdk.org/project/dpdk/list/?series=3D1232 Just a reminder that's v2, and the patch won't apply cleanly on the latest revision > =C2=A0doc/api/meson.build=C2=A0=C2=A0=C2=A0=C2=A0|=C2=A0=C2=A03 ++- > =C2=A0doc/guides/meson.build | 16 ++++++++++++++++ > =C2=A0doc/meson.build=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0| 11= +++++++++++ > =C2=A03 files changed, 29 insertions(+), 1 deletion(-) > =C2=A0create mode 100644 doc/guides/meson.build >=20 > diff --git a/doc/api/meson.build b/doc/api/meson.build > index 5dfa0fe04..f9bee4dac 100644 > --- a/doc/api/meson.build > +++ b/doc/api/meson.build > @@ -50,5 +50,6 @@ if doxygen.found() > =C2=A0 install_dir: htmldir, > =C2=A0 build_by_default: false) > =C2=A0 > - run_target('doc', command: 'true', depends: doxy_build) > + doc_targets +=3D doxy_build > + doc_target_names +=3D 'Doxygen_API' > =C2=A0endif > diff --git a/doc/guides/meson.build b/doc/guides/meson.build > new file mode 100644 > index 000000000..6d1e2990d > --- /dev/null > +++ b/doc/guides/meson.build > @@ -0,0 +1,16 @@ > +# SPDX-License-Identifier: BSD-3-Clause > +# Copyright(c) 2017 Intel Corporation s/2017/2018 > +sphinx =3D find_program('sphinx-build', required: > get_option('enable_docs')) > + > +if sphinx.found() > + html_guides_build =3D custom_target('html_guides_build', > + input: meson.current_source_dir(), > + output: 'index.html', As we discussed I don't have a good solution, but right now running ninja will rebuild these sphinx docs again and again, which will be a bit annoying when using enable_docs=3Dtrue as it will always happen. Changing output to 'html' fixes the issue and it makes it build only once, but then they won't rebuild if the docs change as you noted. > + command: [sphinx, '-b', 'html', '@INPUT@', > meson.current_build_dir() + '/html'], > + build_by_default: false, > + install: get_option('enable_docs')) > + > + doc_targets +=3D html_guides_build > + doc_target_names +=3D 'HTML_Guides' > +endif > diff --git a/doc/meson.build b/doc/meson.build > index afca2e713..c5410d85d 100644 > --- a/doc/meson.build > +++ b/doc/meson.build > @@ -1,4 +1,15 @@ > =C2=A0# SPDX-License-Identifier: BSD-3-Clause > =C2=A0# Copyright(c) 2018 Luca Boccassi > =C2=A0 > +doc_targets =3D [] > +doc_target_names =3D [] > =C2=A0subdir('api') > +subdir('guides') > + > +if doc_targets.length() =3D=3D 0 > + message =3D 'No docs targets found' > +else > + message =3D 'Building docs:' > +endif > +run_target('doc', command: ['echo', message, doc_target_names], > + depends: doc_targets) One thing that's missing is the install_dir, without which ninja install doesn't work (actually errors out for the whole tree). To keep the install the same as the legacy makefiles this diff is needed (I need to change the outdir in the doxygen stuff too, v5 coming) (in the build dir it will be slightly awkward as it's build/doc/guides/guides and build/doc/api/api, but I can't find another way to get it to work and install in the expected directories): --- a/doc/guides/meson.build +++ b/doc/guides/meson.build @@ -4,12 +4,14 @@ sphinx =3D find_program('sphinx-build', required: get_option('enable_docs'= )) =20 if sphinx.found() + htmldir =3D join_paths('share', 'doc', 'dpdk') html_guides_build =3D custom_target('html_guides_build', input: meson.current_source_dir(), - output: 'index.html', - command: [sphinx, '-b', 'html', '@INPUT@', meson.current_bu= ild_dir() + '/html'], + output: 'guides', + command: [sphinx, '-b', 'html', '@INPUT@', meson.current_bu= ild_dir() + '/guides'], build_by_default: false, - install: get_option('enable_docs')) + install: get_option('enable_docs'), + install_dir: htmldir) =20 doc_targets +=3D html_guides_build doc_target_names +=3D 'HTML_Guides' --=20 Kind regards, Luca Boccassi