From f8dbdc42e08a2a6dde5f4bb2e5fdaefb96f26cea Mon Sep 17 00:00:00 2001 From: Don Huettl Date: Mon, 5 May 2025 10:13:06 -0500 Subject: [PATCH] make subprojects conditional Only attempt to build subprojects if the dependencies are actually missing. --- meson.build | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/meson.build b/meson.build index 68bce85b3..5770388a1 100644 --- a/meson.build +++ b/meson.build @@ -40,21 +40,28 @@ if is_freebsd endif # Execute the scenefx subproject, if any -subproject( - 'scenefx', - required: false, -) scenefx = dependency('scenefx-0.2', fallback: 'scenefx') +if not scenefx.found() + subproject( + 'scenefx', + required: false, + ) +endif + # Execute the wlroots subproject, if any wlroots_version = ['>=0.18.0', '<0.19.0'] -subproject( - 'wlroots', - default_options: ['examples=false'], - required: false, - version: wlroots_version, -) wlroots = dependency('wlroots-0.18', version: wlroots_version, fallback: 'wlroots') + +if not wlroots.found() + subproject( + 'wlroots', + default_options: ['examples=false'], + required: false, + version: wlroots_version, + ) +endif + wlroots_features = { 'xwayland': false, 'libinput_backend': false,