From ea0752016907ce406f709b319c5d6c459b16f1c0 Mon Sep 17 00:00:00 2001 From: Ilia Bozhinov Date: Mon, 4 Sep 2023 08:32:02 +0200 Subject: [PATCH] meson.build: try to bail out early if forcing system wlroots but it can't be used Fixes #1175 --- meson.build | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 9413f8f25..9050dfb3e 100644 --- a/meson.build +++ b/meson.build @@ -31,8 +31,16 @@ pixman = dependency('pixman-1') threads = dependency('threads') xkbcommon = dependency('xkbcommon') libdl = meson.get_compiler('cpp').find_library('dl') -wlroots = dependency('wlroots', version: ['>=0.16.0', '<0.17.0'], required: get_option('use_system_wlroots')) -wfconfig = dependency('wf-config', version: ['>=0.8.0', '<0.9.0'], required: get_option('use_system_wfconfig')) +wlroots = dependency('wlroots', version: ['>=0.16.0', '<0.17.0'], required: false) +wfconfig = dependency('wf-config', version: ['>=0.8.0', '<0.9.0'], required: false) + +if get_option('use_system_wlroots').enabled() and not wlroots.found() + error('User specified use_system_wlroots=true, but system wlroots not found!') +endif + +if get_option('use_system_wfconfig').enabled() and not wfconfig.found() + error('User specified use_system_wfconfig=true, but system wfconfig not found!') +endif use_system_wlroots = not get_option('use_system_wlroots').disabled() and wlroots.found() if not use_system_wlroots