From 25d047c2b943f1bcf72c02814512fdd8710648e1 Mon Sep 17 00:00:00 2001 From: ALTracer Date: Sun, 2 Jun 2024 17:15:59 +0300 Subject: [PATCH] build: Make libSDL2 optional and only link orblcd against it * Only orblcd requires libSDL2. * Allow building the command-line tools if libSDL2 is not found. * Don't link them all against libSDL2. --- meson.build | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 283aecf7..e63b8817 100644 --- a/meson.build +++ b/meson.build @@ -13,7 +13,6 @@ dependencies = [ dependency('threads'), dependency('libusb-1.0'), dependency('libzmq'), - dependency('SDL2'), dependency('ncurses', 'ncursesw'), dependency('libelf'), uicolours_default, @@ -51,6 +50,11 @@ if not libcapstone.found() libcapstone = disabler() endif +libSDL2 = dependency('SDL2', required: false) +if not libSDL2.found() + libSDL2 = disabler() +endif + if host_machine.system() == 'windows' stream_src = [ 'Src/stream_win32.c', @@ -227,7 +231,9 @@ executable('orblcd', git_version_info_h, ], include_directories: incdirs, - dependencies: dependencies, + dependencies: dependencies + [ + libSDL2, + ], link_with: liborb, install: true, )