mirror of
https://github.com/libratbag/libratbag.git
synced 2026-11-07 23:23:52 +01:00
Merge ratbagd's meson file into libratbag's
I couldn't get the subdir() to work, it would throw exceptions somewhere internal to meson. So instead, just merge the two together. This still builds everything as before, it's just a single meson file now. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
84
meson.build
84
meson.build
@@ -38,11 +38,14 @@ add_project_arguments(cppflags, language: 'cpp')
|
||||
# is generated at the end of this file
|
||||
config_h = configuration_data()
|
||||
config_h.set('_GNU_SOURCE', '1')
|
||||
libratbag_data_dir = join_paths(get_option('datadir'), 'libratbag')
|
||||
config_h.set_quoted('LIBRATBAG_DATA_DIR', libratbag_data_dir)
|
||||
|
||||
# dependencies
|
||||
pkgconfig = import('pkgconfig')
|
||||
dep_udev = dependency('libudev')
|
||||
dep_libevdev = dependency('libevdev')
|
||||
dep_systemd = dependency('libsystemd', version : '>=227')
|
||||
dep_lm = cc.find_library('m')
|
||||
|
||||
#### libutil.a ####
|
||||
@@ -399,5 +402,86 @@ if enable_doc
|
||||
build_by_default : true)
|
||||
endif
|
||||
|
||||
#### librbdshared.a ####
|
||||
src_librbdshared = [
|
||||
'ratbagd/src/shared-macro.h',
|
||||
'ratbagd/src/shared-rbtree.h',
|
||||
'ratbagd/src/shared-rbtree.c',
|
||||
]
|
||||
|
||||
deps_librbdshared = [
|
||||
dep_lm,
|
||||
]
|
||||
|
||||
lib_librbdshared = static_library('rbdshared',
|
||||
src_librbdshared,
|
||||
dependencies : deps_librbdshared
|
||||
)
|
||||
dep_librbdshared = declare_dependency(link_with: lib_librbdshared)
|
||||
|
||||
#### ratbagd ####
|
||||
src_ratbagd = [
|
||||
'ratbagd/src/ratbagd.h',
|
||||
'ratbagd/src/ratbagd.c',
|
||||
'ratbagd/src/ratbagd-led.c',
|
||||
'ratbagd/src/ratbagd-button.c',
|
||||
'ratbagd/src/ratbagd-device.c',
|
||||
'ratbagd/src/ratbagd-profile.c',
|
||||
'ratbagd/src/ratbagd-resolution.c'
|
||||
]
|
||||
|
||||
deps_ratbagd = [
|
||||
dep_udev,
|
||||
dep_systemd,
|
||||
dep_librbdshared,
|
||||
dep_libratbag,
|
||||
]
|
||||
|
||||
executable('ratbagd',
|
||||
src_ratbagd,
|
||||
dependencies : deps_ratbagd,
|
||||
include_directories : include_directories('src'),
|
||||
install : true,
|
||||
)
|
||||
|
||||
install_man('ratbagd/doc/ratbagd.8')
|
||||
|
||||
#### unit file ####
|
||||
unitdir = get_option('systemd-unit-dir')
|
||||
if unitdir == ''
|
||||
unitdir = get_option('libdir') + '/systemd/system'
|
||||
endif
|
||||
|
||||
config_bindir = configuration_data()
|
||||
config_bindir.set('bindir', join_paths(get_option('prefix'), get_option('bindir')))
|
||||
|
||||
configure_file(input : 'ratbagd/ratbagd.service.in',
|
||||
output : 'ratbagd.service',
|
||||
configuration : config_bindir,
|
||||
install_dir : unitdir)
|
||||
|
||||
dbusdir = get_option('dbus-root-dir')
|
||||
if dbusdir == ''
|
||||
dbusdir = join_paths(get_option('datadir'), 'dbus-1')
|
||||
endif
|
||||
|
||||
configure_file(input : 'ratbagd/dbus/org.freedesktop.ratbag1.service.in',
|
||||
output : 'org.freedesktop.ratbag1.service',
|
||||
configuration : config_bindir,
|
||||
install_dir : join_paths(dbusdir, 'system-services'))
|
||||
install_data('ratbagd/dbus/org.freedesktop.ratbag1.conf',
|
||||
configuration : config_bindir,
|
||||
install_dir : join_paths(dbusdir, 'system.d'))
|
||||
|
||||
#### tools ####
|
||||
config_ratbagctl = configuration_data()
|
||||
config_ratbagctl.set('version', meson.project_version())
|
||||
configure_file(input : 'ratbagd/tools/ratbagctl.in',
|
||||
output : 'ratbagctl',
|
||||
configuration : config_ratbagctl,
|
||||
install_dir : get_option('bindir'))
|
||||
install_man('ratbagd/doc/ratbagctl.1')
|
||||
|
||||
#### output files ####
|
||||
configure_file(output: 'config.h', install: false, configuration: config_h)
|
||||
|
||||
|
||||
@@ -12,3 +12,13 @@ option('enable-documentation',
|
||||
type: 'boolean',
|
||||
value: true,
|
||||
description: 'Build the documentation (default=yes)')
|
||||
|
||||
option('systemd-unit-dir',
|
||||
type : 'string',
|
||||
default : '',
|
||||
description : 'systemd unit directory [default=$libdir/systemd/system]')
|
||||
|
||||
option('dbus-root-dir',
|
||||
type : 'string',
|
||||
default : '',
|
||||
description : 'dbus service directory [default=$datadir/dbus-1]')
|
||||
|
||||
@@ -1,141 +0,0 @@
|
||||
project('ratbagd', 'c',
|
||||
version : '0.4',
|
||||
license : 'MIT/Expat',
|
||||
meson_version : '>= 0.40.0',
|
||||
default_options : [ 'c_std=gnu99', 'warning_level=2' ])
|
||||
|
||||
ratbagd_version = meson.project_version().split('.')
|
||||
|
||||
# Compiler setup
|
||||
cc = meson.get_compiler('c')
|
||||
cflags = [
|
||||
'-Wno-inline',
|
||||
'-Wundef',
|
||||
'-Wformat=2',
|
||||
'-Wformat-security',
|
||||
'-Wformat-nonliteral',
|
||||
'-Wlogical-op',
|
||||
'-Wsign-compare',
|
||||
'-Wmissing-include-dirs',
|
||||
'-Wold-style-definition',
|
||||
'-Wpointer-arith',
|
||||
'-Winit-self',
|
||||
'-Wdeclaration-after-statement',
|
||||
'-Wfloat-equal',
|
||||
'-Wsuggest-attribute=noreturn',
|
||||
'-Wmissing-prototypes',
|
||||
'-Wstrict-prototypes',
|
||||
'-Wredundant-decls',
|
||||
'-Wmissing-declarations',
|
||||
'-Wmissing-noreturn',
|
||||
'-Wendif-labels',
|
||||
'-Wstrict-aliasing=2',
|
||||
'-Wwrite-strings',
|
||||
'-Wno-long-long',
|
||||
'-Wno-overlength-strings',
|
||||
'-Wno-unused-parameter',
|
||||
'-Wno-missing-field-initializers',
|
||||
'-Wno-unused-result',
|
||||
'-Werror=overflow',
|
||||
'-Wdate-time',
|
||||
'-Wnested-externs',
|
||||
]
|
||||
add_project_arguments(cflags, language: 'c')
|
||||
add_project_arguments('-D_GNU_SOURCE', language : 'c')
|
||||
|
||||
# Initialize config.h, to be added to in the various options below, config.h
|
||||
# is generated at the end of this file
|
||||
config_h = configuration_data()
|
||||
|
||||
# dependencies
|
||||
pkgconfig = import('pkgconfig')
|
||||
dep_udev = dependency('libudev')
|
||||
dep_systemd = dependency('libsystemd', version : '>=227')
|
||||
dep_libratbag = dependency('libratbag', version : '>= 0.6')
|
||||
dep_lm = cc.find_library('m')
|
||||
|
||||
libratbag_data_dir = dep_libratbag.get_pkgconfig_variable('pkgdatadir')
|
||||
config_h.set_quoted('LIBRATBAG_DATA_DIR', libratbag_data_dir)
|
||||
|
||||
#### libshared.a ####
|
||||
src_libshared = [
|
||||
'src/shared-macro.h',
|
||||
'src/shared-rbtree.h',
|
||||
'src/shared-rbtree.c',
|
||||
]
|
||||
|
||||
deps_libshared = [
|
||||
dep_lm,
|
||||
]
|
||||
|
||||
lib_libshared = static_library('shared',
|
||||
src_libshared,
|
||||
dependencies : deps_libshared
|
||||
)
|
||||
dep_libshared = declare_dependency(link_with: lib_libshared)
|
||||
|
||||
#### ratbagd ####
|
||||
src_ratbagd = [
|
||||
'src/ratbagd.h',
|
||||
'src/ratbagd.c',
|
||||
'src/ratbagd-led.c',
|
||||
'src/ratbagd-button.c',
|
||||
'src/ratbagd-device.c',
|
||||
'src/ratbagd-profile.c',
|
||||
'src/ratbagd-resolution.c'
|
||||
]
|
||||
|
||||
deps_ratbagd = [
|
||||
dep_udev,
|
||||
dep_systemd,
|
||||
dep_libratbag,
|
||||
dep_libshared,
|
||||
]
|
||||
|
||||
executable('ratbagd',
|
||||
src_ratbagd,
|
||||
dependencies : deps_ratbagd,
|
||||
include_directories : include_directories('src'),
|
||||
install : true,
|
||||
)
|
||||
|
||||
install_man('doc/ratbagd.8')
|
||||
|
||||
#### unit file ####
|
||||
unitdir = get_option('systemd-unit-dir')
|
||||
if unitdir == ''
|
||||
unitdir = get_option('libdir') + '/systemd/system'
|
||||
endif
|
||||
|
||||
config_bindir = configuration_data()
|
||||
config_bindir.set('bindir', join_paths(get_option('prefix'), get_option('bindir')))
|
||||
|
||||
configure_file(input : 'ratbagd.service.in',
|
||||
output : 'ratbagd.service',
|
||||
configuration : config_bindir,
|
||||
install_dir : unitdir)
|
||||
|
||||
dbusdir = get_option('dbus-root-dir')
|
||||
if dbusdir == ''
|
||||
dbusdir = join_paths(get_option('datadir'), 'dbus-1')
|
||||
endif
|
||||
|
||||
configure_file(input : 'dbus/org.freedesktop.ratbag1.service.in',
|
||||
output : 'org.freedesktop.ratbag1.service',
|
||||
configuration : config_bindir,
|
||||
install_dir : join_paths(dbusdir, 'system-services'))
|
||||
install_data('dbus/org.freedesktop.ratbag1.conf',
|
||||
configuration : config_bindir,
|
||||
install_dir : join_paths(dbusdir, 'system.d'))
|
||||
|
||||
#### tools ####
|
||||
config_ratbagctl = configuration_data()
|
||||
config_ratbagctl.set('version', meson.project_version())
|
||||
configure_file(input : 'tools/ratbagctl.in',
|
||||
output : 'ratbagctl',
|
||||
configuration : config_ratbagctl,
|
||||
install_dir : get_option('bindir'))
|
||||
install_man('doc/ratbagctl.1')
|
||||
|
||||
#### output files ####
|
||||
configure_file(output: 'config.h', install: false, configuration: config_h)
|
||||
@@ -1,9 +0,0 @@
|
||||
option('systemd-unit-dir',
|
||||
type : 'string',
|
||||
default : '',
|
||||
description : 'systemd unit directory [default=$libdir/systemd/system]')
|
||||
|
||||
option('dbus-root-dir',
|
||||
type : 'string',
|
||||
default : '',
|
||||
description : 'dbus service directory [default=$datadir/dbus-1]')
|
||||
Reference in New Issue
Block a user