From 46b8a23c2f687fbc02cc6f65af9f192bd3a67675 Mon Sep 17 00:00:00 2001 From: Scoopta Date: Tue, 28 Jan 2020 14:05:01 -0800 Subject: [PATCH] Added build options to turn on/off all built in modes --- meson.build | 41 ++++++++++++++++++++++++++--------------- meson_options.txt | 3 +++ 2 files changed, 29 insertions(+), 15 deletions(-) diff --git a/meson.build b/meson.build index be1679d..94a4a72 100644 --- a/meson.build +++ b/meson.build @@ -3,7 +3,6 @@ cc = meson.get_compiler('c') inc = include_directories('inc') gtk = dependency('gtk+-3.0') -gio = dependency('gio-unix-2.0') threads = dependency('threads') wayland = dependency('wayland-client') dl = cc.find_library('dl') @@ -19,17 +18,29 @@ endif add_project_arguments('-D_GNU_SOURCE', '-DVERSION="' + version + '"', language : 'c') add_project_link_arguments('-rdynamic', language : 'c') -executable(meson.project_name(), -'src/config.c', -'src/main.c', -'src/map.c', -'src/property_box.c', -'src/utils.c', -'src/wofi.c', -'modes/dmenu.c', -'modes/drun.c', -'modes/run.c', -'proto/wlr-layer-shell-unstable-v1-protocol.c', -'proto/xdg-shell-protocol.c', -include_directories : inc, -dependencies : [gtk, gio, threads, wayland, dl], install : true) +sources = ['src/config.c', + 'src/main.c', + 'src/map.c', + 'src/property_box.c', + 'src/utils.c', + 'src/wofi.c', + 'proto/wlr-layer-shell-unstable-v1-protocol.c', + 'proto/xdg-shell-protocol.c'] + +deps = [gtk, threads, wayland, dl] + +if get_option('enable_run') + sources += ['modes/run.c'] +endif + +if get_option('enable_drun') + gio = dependency('gio-unix-2.0') + sources += ['modes/drun.c'] + deps += [gio] +endif + +if get_option('enable_dmenu') + sources += ['modes/dmenu.c'] +endif + +executable(meson.project_name(), sources, include_directories : inc, dependencies : deps, install : true) diff --git a/meson_options.txt b/meson_options.txt index 636de2d..3d7f2f4 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1 +1,4 @@ option('version', type : 'string', value : 'hg', description : 'The version to use if mercurial cannot be found') +option('enable_run', type : 'boolean', value : true, description : 'Whether run mode should be enabled') +option('enable_drun', type : 'boolean', value : true, description : 'Whether drun mode should be enabled') +option('enable_dmenu', type : 'boolean', value : true, description : 'Whether dmenu mode should be enabled') \ No newline at end of file