From 52747d70e05de4da76767630e725e80b22b08029 Mon Sep 17 00:00:00 2001 From: Kyle Brenneman Date: Mon, 4 Oct 2021 09:23:15 -0600 Subject: [PATCH] meson: Don't use x11 at all if the x11 feature is disabled. Currently, building with -Dx11=disabled or -Dx11=auto gives identical results. In both cases, it only makes the x11 dependency optional: It'll still look for libx11, and if libx11 is available, then it'll still build with X11 support enabled. This changes the meson build so that if you pass -Dx11=disabled, then it will use a dummy dependency for x11, which will cause it to build as if libx11 was not available. --- meson.build | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index cbe2ec4..a462465 100644 --- a/meson.build +++ b/meson.build @@ -87,7 +87,12 @@ endif dep_dl = cc.find_library('dl', required : false) dep_m = cc.find_library('m', required : false) dep_threads = dependency('threads') -dep_x11 = dependency('x11', required : get_option('x11')) +if get_option('x11').disabled() + dep_x11 = dependency('', required : false) +else + dep_x11 = dependency('x11', required : get_option('x11')) +endif + dep_x11_headers = dep_x11.partial_dependency(compile_args : true, includes : true) if dep_x11.found() add_project_arguments('-DUSE_X11', language : ['c'])