79 lines
2.0 KiB
Meson
79 lines
2.0 KiB
Meson
project('acpi-event-handler', 'c')
|
|
|
|
add_project_arguments([
|
|
'-DLOG_USE_COLOR' # enable colored logs
|
|
], language: 'c')
|
|
|
|
srcfiles = files(
|
|
'src/main.c',
|
|
'src/led.c',
|
|
'src/wayland.c',
|
|
'src/acpi.c',
|
|
'src/utils.c',
|
|
'src/battery.c',
|
|
'src/config.c'
|
|
)
|
|
|
|
# wayland stuff
|
|
wscanner = dependency('wayland-scanner', native: true)
|
|
wscanner_prog = find_program(
|
|
wscanner.get_variable('wayland_scanner'), native: true)
|
|
|
|
wayland_protocols = dependency('wayland-protocols', version: '>=1.41',
|
|
default_options: ['tests=false'])
|
|
wayland_protocols_datadir = wayland_protocols.get_variable('pkgdatadir')
|
|
wayland_client = dependency('wayland-client')
|
|
wayland_server = dependency('wayland-server')
|
|
wl_proto_c = []
|
|
wl_proto_h = []
|
|
wl_proto_xml = [
|
|
wayland_protocols_datadir / 'unstable/idle-inhibit/idle-inhibit-unstable-v1.xml'
|
|
]
|
|
|
|
foreach prot : wl_proto_xml
|
|
wl_proto_h += custom_target(
|
|
prot.underscorify() + '-client-header',
|
|
input: prot,
|
|
output: '@BASENAME@.h',
|
|
command: [ wscanner_prog, 'client-header', '@INPUT@', '@OUTPUT@' ])
|
|
|
|
wl_proto_c += custom_target(
|
|
prot.underscorify() + '-private-code',
|
|
input: prot,
|
|
output: '@BASENAME@.c',
|
|
command: [ wscanner_prog, 'private-code', '@INPUT@', '@OUTPUT@' ])
|
|
endforeach
|
|
|
|
# build stuff
|
|
cc = meson.get_compiler('c')
|
|
math_dep = cc.find_library('m', required: true)
|
|
|
|
executable('eh', srcfiles,
|
|
wl_proto_c + wl_proto_h,
|
|
dependencies: [
|
|
math_dep,
|
|
wayland_client,
|
|
wayland_server
|
|
],
|
|
include_directories: [
|
|
'lib/log.c/src',
|
|
'lib/tinyexpr',
|
|
'lib/tomlc99',
|
|
'lib/cargs/include',
|
|
'include'
|
|
],
|
|
link_with: [
|
|
static_library('log.c', 'lib/log.c/src/log.c',
|
|
include_directories: 'lib/log.c/src'),
|
|
|
|
static_library('tinyexpr', 'lib/tinyexpr/tinyexpr.c',
|
|
include_directories: 'lib/tinyexpr'),
|
|
|
|
static_library('tomlc99', 'lib/tomlc99/toml.c',
|
|
include_directories: 'lib/tomlc99'),
|
|
|
|
static_library('cargs', 'lib/cargs/src/cargs.c',
|
|
include_directories: 'lib/cargs/include')
|
|
]
|
|
)
|