Skip to content

Commit

Permalink
Use boolean type for with_coverage build option
Browse files Browse the repository at this point in the history
Use boolean type instead of combo for `with_coverage` build option

Signed-off-by: Martin Perina <[email protected]>
  • Loading branch information
mwperina authored and engelmi committed Feb 13, 2024
1 parent e7286cb commit f47fba0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ endif

# Set option to get coverage collection
with_coverage = get_option('with_coverage')
if with_coverage == 'true'
if with_coverage
add_project_arguments('-coverage', language : 'c')
add_project_arguments(
'-fprofile-dir=' + join_paths(get_option('prefix'), get_option('localstatedir'), 'tmp', 'bluechi-coverage'),
'-fprofile-dir=' + join_paths(get_option('prefix'), get_option('localstatedir'), 'tmp', 'bluechi-coverage'),
language : 'c')
add_project_link_arguments('-lgcov', language : 'c')
# Coverage source code mapping files `*.gcno` are created as a part of the build for each `*.c` file, but it's
Expand Down
5 changes: 2 additions & 3 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ option('dbus-srv-user', type: 'string', description: 'The (existing) user which
option('with_analyzer', type : 'boolean', value : false,
description : 'Add the gcc option -fanalyzer for static analysis')

option('with_coverage', type : 'combo',
choices : ['true', 'false'], value : 'false',
description : 'Add coverage collection')
option('with_coverage', type : 'boolean', value : false,
description : 'Enable the code coverage collection')

option('with_man_pages', type : 'boolean', value : true,
description : 'Build and install man pages')

0 comments on commit f47fba0

Please sign in to comment.