2024-02-11 23:30:12 -05:00
|
|
|
project('wofi', 'c', version : 'hg', default_options : ['c_std=c99', 'buildtype=release', 'warning_level=2'])
|
2019-12-20 21:29:11 -05:00
|
|
|
cc = meson.get_compiler('c')
|
|
|
|
|
2020-03-05 14:35:55 -05:00
|
|
|
pkgcfg = import('pkgconfig')
|
|
|
|
|
2019-12-20 21:29:11 -05:00
|
|
|
inc = include_directories('inc')
|
|
|
|
gtk = dependency('gtk+-3.0')
|
|
|
|
wayland = dependency('wayland-client')
|
2020-06-23 03:33:57 -04:00
|
|
|
threads = dependency('threads')
|
2019-12-20 21:29:11 -05:00
|
|
|
dl = cc.find_library('dl')
|
|
|
|
|
2019-12-30 21:35:26 -05:00
|
|
|
hg = find_program('hg', native : true, required : false)
|
|
|
|
|
2020-02-29 01:02:10 -05:00
|
|
|
version = meson.project_version()
|
2019-12-30 21:35:26 -05:00
|
|
|
|
|
|
|
if hg.found()
|
2022-02-14 00:05:17 -05:00
|
|
|
version = run_command(hg, 'identify', check : true).stdout().strip()
|
2019-12-30 21:35:26 -05:00
|
|
|
endif
|
|
|
|
|
|
|
|
add_project_arguments('-D_GNU_SOURCE', '-DVERSION="' + version + '"', language : 'c')
|
2019-12-20 21:29:11 -05:00
|
|
|
add_project_link_arguments('-rdynamic', language : 'c')
|
|
|
|
|
2020-01-28 17:05:01 -05:00
|
|
|
sources = ['src/config.c',
|
|
|
|
'src/main.c',
|
|
|
|
'src/map.c',
|
2022-06-25 20:51:48 -04:00
|
|
|
'src/match.c',
|
2020-01-28 17:05:01 -05:00
|
|
|
'src/property_box.c',
|
2020-07-11 20:39:09 -04:00
|
|
|
'src/utils_g.c',
|
2020-01-28 17:05:01 -05:00
|
|
|
'src/utils.c',
|
2020-06-23 01:45:51 -04:00
|
|
|
'src/widget_builder.c',
|
2020-01-28 17:05:01 -05:00
|
|
|
'src/wofi.c',
|
|
|
|
'proto/wlr-layer-shell-unstable-v1-protocol.c',
|
2020-02-25 20:14:42 -05:00
|
|
|
'proto/xdg-output-unstable-v1-protocol.c',
|
2020-01-28 17:05:01 -05:00
|
|
|
'proto/xdg-shell-protocol.c']
|
|
|
|
|
2020-06-23 03:33:57 -04:00
|
|
|
deps = [gtk, wayland, dl, threads]
|
2020-01-28 17:05:01 -05:00
|
|
|
|
|
|
|
if get_option('enable_run')
|
2020-02-29 01:04:49 -05:00
|
|
|
sources += 'modes/run.c'
|
2020-01-28 17:05:01 -05:00
|
|
|
endif
|
|
|
|
|
|
|
|
if get_option('enable_drun')
|
2020-02-29 01:04:49 -05:00
|
|
|
sources += 'modes/drun.c'
|
|
|
|
deps += dependency('gio-unix-2.0')
|
2020-01-28 17:05:01 -05:00
|
|
|
endif
|
|
|
|
|
|
|
|
if get_option('enable_dmenu')
|
2020-02-29 01:04:49 -05:00
|
|
|
sources += 'modes/dmenu.c'
|
2020-01-28 17:05:01 -05:00
|
|
|
endif
|
|
|
|
|
2020-02-26 02:06:00 -05:00
|
|
|
install_man('man/wofi.1',
|
|
|
|
'man/wofi.3',
|
|
|
|
'man/wofi.5',
|
|
|
|
'man/wofi.7',
|
|
|
|
'man/wofi-api.3',
|
|
|
|
'man/wofi-config.3',
|
|
|
|
'man/wofi-keys.7',
|
|
|
|
'man/wofi-map.3',
|
2020-08-26 22:38:02 -04:00
|
|
|
'man/wofi-utils.3',
|
|
|
|
'man/wofi-widget-builder.3')
|
2020-02-26 02:06:00 -05:00
|
|
|
|
2020-03-05 14:35:55 -05:00
|
|
|
subdir = 'wofi-1'
|
|
|
|
|
|
|
|
install_headers('inc/config.h',
|
|
|
|
'inc/map.h',
|
2020-07-11 20:39:09 -04:00
|
|
|
'inc/utils_g.h',
|
2020-03-05 14:35:55 -05:00
|
|
|
'inc/utils.h',
|
2020-06-30 00:25:15 -04:00
|
|
|
'inc/widget_builder_api.h',
|
2020-03-05 14:35:55 -05:00
|
|
|
'inc/wofi_api.h',
|
|
|
|
subdir : subdir)
|
|
|
|
|
|
|
|
pkgcfg.generate(name : meson.project_name(),
|
|
|
|
description : 'Wofi API for developing modes',
|
|
|
|
requires : wayland,
|
|
|
|
subdirs : subdir)
|
|
|
|
|
2020-03-05 14:37:51 -05:00
|
|
|
executable(meson.project_name(), sources, include_directories : inc, dependencies : deps, install : true)
|