meson: Provide options to disable test/docs

It can be desirable to disable the compilation and processing of both
the test suite and documentation for use cases such as packaging to an
embedded target.

Provide a new meson_options.txt file to allow disabling either or both
of the tests and documentation components of libcamera.

These options can be provided at the initial configuration time, for
example:

  meson build -Dtests=false -Ddocumentation=false

or by reconfiguring an existing build tree:

  cd build
  meson configure -Ddocumentation=false
  meson configure -Dtests=false

Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
Kieran Bingham 2019-03-20 15:44:08 +00:00
parent 651f6973a0
commit 945478dbc0
2 changed files with 10 additions and 2 deletions

View file

@ -27,9 +27,15 @@ libcamera_includes = include_directories('include')
subdir('include') subdir('include')
subdir('src') subdir('src')
subdir('test')
subdir('utils') subdir('utils')
subdir('Documentation')
if get_option('tests')
subdir('test')
endif
if get_option('documentation')
subdir('Documentation')
endif
pkg_mod = import('pkgconfig') pkg_mod = import('pkgconfig')
pkg_mod.generate(libraries : libcamera, pkg_mod.generate(libraries : libcamera,

2
meson_options.txt Normal file
View file

@ -0,0 +1,2 @@
option('tests', type : 'boolean')
option('documentation', type : 'boolean')