Skip to content

Commit

Permalink
meson: use booleans for conf.set and drop unecessary conditionals
Browse files Browse the repository at this point in the history
Using conf.set() with a boolean argument does the right thing:
either #ifdef or #undef. This means that conf.set can be used unconditionally.

Previously I used '1' as the placeholder value, and that needs to be changed to
'true' for consistency (under meson 1 cannot be used in boolean context). All
checks need to be adjusted.
  • Loading branch information
keszybz committed May 2, 2017
1 parent 829257d commit 2c201c2
Show file tree
Hide file tree
Showing 29 changed files with 140 additions and 170 deletions.
2 changes: 1 addition & 1 deletion docs/sysvinit/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ file = configure_file(
output : 'README',
configuration : substs)

if conf.get('HAVE_SYSV_COMPAT', 0) == 1
if conf.get('HAVE_SYSV_COMPAT', false)
install_data(file,
install_dir : sysvinit_path)
endif
2 changes: 1 addition & 1 deletion docs/var-log/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ file = configure_file(
output : 'README',
configuration : substs)

if conf.get('HAVE_SYSV_COMPAT', 0) == 1
if conf.get('HAVE_SYSV_COMPAT', false)
install_data(file,
install_dir : varlogdir)
endif
2 changes: 1 addition & 1 deletion hwdb/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ hwdb_files = files('''
70-touchpad.hwdb
'''.split())

if conf.get('ENABLE_HWDB', 0) == 1
if conf.get('ENABLE_HWDB', false)
install_data(hwdb_files,
install_dir : udevhwdbdir)

Expand Down
2 changes: 1 addition & 1 deletion man/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ foreach tuple : manpages

mandirn = join_paths(get_option('mandir'), 'man' + section)

if condition == '' or conf.get(condition, 0) == 1
if condition == '' or conf.get(condition, false)
p1 = custom_target(
man,
input : xml,
Expand Down
Loading

0 comments on commit 2c201c2

Please sign in to comment.