[README,doc,meson*] Rework documentation build

* Avoid going through hoops to silently enable docs if doxygen is
  available
* Require build-doc explicitly set to true before scanning for doxygen
* build-doc is conservatively false by default
* Update README
This commit is contained in:
Lorenzo Cogotti 2023-05-25 22:51:22 +02:00
parent 20d0b9bd44
commit d09c5ddee4
4 changed files with 12 additions and 10 deletions

View File

@ -90,15 +90,18 @@ for more advanced build management tasks.
The Micro BGP Suite uses [Doxygen](https://www.doxygen.org/index.html) to document its API.
In order to build `µbgpsuite` documentation you must enable the `build-doc`
configure flag. This flag is enabled automatically if you have `doxygen`
installed in your system when you run `meson` to configure the project for the
first time.
configure flag.
To do so, run the following command inside an already existing `build` directory:
```sh
$ meson configure -Dbuild-doc=true
```
Once the flag is enabled, you can use:
```sh
$ ninja doc
```
inside build directory to generate Doxygen documentation.
inside the build directory to generate the Doxygen documentation.
You can access the documentation by pointing your web browser to
`doc/html/index.html` inside the build directory.

View File

@ -6,6 +6,8 @@ cdata = configuration_data({
'PROJECT_NAME': meson.project_name(),
})
doxygen = find_program('doxygen')
doxyfile = configure_file(input : 'Doxyfile.in',
output : 'Doxyfile',
configuration : cdata,

View File

@ -97,11 +97,8 @@ lonetix_dep = declare_dependency(compile_args : lonetix_args,
# TODO
# endif
doxygen = find_program('doxygen', required : get_option('build-doc'))
if doxygen.found()
if get_option('build-doc')
subdir('doc')
elif get_option('build-doc').auto()
message('Not building documentation as doxygen was not found')
endif
if get_option('build-bgpgrep')

View File

@ -1,7 +1,7 @@
option('native', type : 'boolean', value : false, description : 'Optimize build for local CPU architecture (ties build artifacts to your local machine!)')
option('build-doc', type : 'boolean', description : 'Build documentation using doxygen')
option('build-doc', type : 'boolean', value : false, description : 'Build documentation using doxygen')
# TODO option('build-benchmarks', type : 'boolean', value : false, description : 'Build benchmarks')
option('build-tests', type : 'boolean', value : false, description : 'Build tests')
option('build-bgpgrep', type : 'boolean', description : 'Build bgpgrep MRT/BGP parsing and filting utility')
option('build-peerindex', type : 'boolean', description : 'Build peerindex MRT TABLE_DUMPV2 Peer Index Table inspection tool')
option('bgpscanner-legacy', type : 'boolean', value : false, description : 'Install a legacy wrapper script for backwards compatibility with Isolario bgpscanner')
option('bgpscanner-legacy', type : 'boolean', value : false, description : 'Install a legacy wrapper script for backwards compatibility with Isolario bgpscanner')