meson.build: fix the ratbagd runtime check

find_program(required: true) exits with the meson error message if the
program is not found so we never get to our pretty error message.
Fix this and make the message an actual error too.

Also indent the else condition correctly while we're here.
This commit is contained in:
Peter Hutterer
2023-07-12 09:47:44 +10:00
parent c7e1ad8fab
commit b8a97fd367

View File

@@ -16,7 +16,7 @@ enable_runtime_dependency_checks = get_option('runtime-dependency-checks')
# Dependencies
if enable_runtime_dependency_checks
ratbagd = find_program('ratbagd', required: true)
ratbagd = find_program('ratbagd', required: false)
ratbagd_required_version='0.17'
if not ratbagd.found()
@@ -31,16 +31,16 @@ if enable_runtime_dependency_checks
else
r = run_command(ratbagd, '--version')
if r.returncode() != 0 or r.stdout().version_compare('<' + ratbagd_required_version)
error('''
************************ ERROR *****************************
* ( )( *
* (\-. ) ( ) ratbagd found in $PATH is too *
* / _`> .---------. old and will not work with *
* _) / _)= |'-------'| this version of Piper. Please *
*( / _/ |O O o| update libratbag/ratbagd. *
* `-.__(___)_ | o O . o | *
************************************************************
''')
error('''
************************ ERROR *****************************
* ( )( *
* (\-. ) ( ) ratbagd found in $PATH is too *
* / _`> .---------. old and will not work with *
* _) / _)= |'-------'| this version of Piper. Please *
*( / _/ |O O o| update libratbag/ratbagd. *
* `-.__(___)_ | o O . o | *
************************************************************
''')
endif
endif