Skip to content

Commit

Permalink
Hide README generation behind disabled-by-default meson option (see #222
Browse files Browse the repository at this point in the history
)
  • Loading branch information
Siborgium committed Nov 25, 2022
1 parent 70f3390 commit c4d8d36
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
17 changes: 8 additions & 9 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,15 @@ if get_option('grid')
subdir('grid')
endif

python = find_program('python3', required: false)
if not python.found()
python = find_program('python', required: false)
endif
if get_option('generate-readme')
python = find_program('python3', required: false)
if not python.found()
message('python3 not found in PATH, trying python...')
python = find_program('python', required: true)
endif

# generate README.md from template
# make sure to copy it to the source directory!
if python.found()
# generate README.md from template
# make sure to copy it to the source directory!
readme = custom_target('readme',
output: [ 'README.md' ],
input: [ 'README.md.in' ],
Expand All @@ -90,8 +91,6 @@ if python.found()
install_dir: conf_data.get('datadir'),
install: true
)
else
message('Python was not found, fresh README.md will not be generated')
endif

install_data(
Expand Down
1 change: 1 addition & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ option('dmenu', type: 'boolean', value: true, description: 'Build the dmenu app.
option('grid', type: 'boolean', value: true, description: 'Build the grid app.')
option('layer-shell', type: 'feature', value: 'auto', description: 'Enable layer-shell support')
option('gdk-x11', type: 'feature', value: 'auto', description: 'Use Gdk X11 API')
option('generate-readme', type: 'boolean', value: false, description: 'Generate fresh README.md in build directory')

0 comments on commit c4d8d36

Please sign in to comment.