From 2c672620b97192147d85ff17760238c6e0a8eee3 Mon Sep 17 00:00:00 2001 From: Erik Reider <35975961+ErikReider@users.noreply.github.com> Date: Tue, 7 May 2024 19:24:19 +0200 Subject: [PATCH] Only look for wlroots subproject if dep isn't found --- meson.build | 18 +++++++++++------- render/fx_renderer/meson.build | 8 +++----- types/meson.build | 10 ++++------ 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/meson.build b/meson.build index 31da09e..0f105e9 100644 --- a/meson.build +++ b/meson.build @@ -92,18 +92,22 @@ wayland_server = dependency('wayland-server', default_options: wayland_project_options, ) -wlroots_options = [ 'examples=false', 'default_library=static' ] +wlroots_options = [ 'examples=false' ] wlroots_version = ['>=0.17.0', '<0.18.0'] -wlroots_is_sub = subproject( - 'wlroots', - default_options: wlroots_options, - required: false, - version: wlroots_version, -).found() wlroots = dependency('wlroots', version: wlroots_version, default_options: wlroots_options, + required: false, ) +if not wlroots.found() + wlroots_proj = subproject( + 'wlroots', + default_options: wlroots_options, + version: wlroots_version, + ) + wlroots = wlroots_proj.get_variable('wlroots') +endif + drm = dependency('libdrm', version: '>=2.4.114', diff --git a/render/fx_renderer/meson.build b/render/fx_renderer/meson.build index f8e7b9b..8759df4 100644 --- a/render/fx_renderer/meson.build +++ b/render/fx_renderer/meson.build @@ -16,11 +16,9 @@ wlr_files += files( 'fx_renderer.c', ) -if not wlroots_is_sub - wlr_files += files([ - 'matrix.c', - ]) -endif +wlr_files += files([ + 'matrix.c', +]) if 'gles2' in renderers or 'auto' in renderers egl = dependency('egl', required: 'gles2' in renderers) diff --git a/types/meson.build b/types/meson.build index 29e9c36..dc0b332 100644 --- a/types/meson.build +++ b/types/meson.build @@ -2,11 +2,9 @@ wlr_files += files( 'scene/wlr_scene.c', ) -if not wlroots_is_sub - wlr_files += files([ - 'output/wlr_output.c', - 'buffer/buffer.c', - ]) -endif +wlr_files += files([ + 'output/wlr_output.c', + 'buffer/buffer.c', +]) subdir('fx')