[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
pull/2/head
Lorenzo Cogotti 2 years ago
parent 20d0b9bd44
commit d09c5ddee4

@ -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.

@ -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,

@ -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')

@ -1,5 +1,5 @@
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')

Loading…
Cancel
Save