1
0
mirror of https://github.com/MatMoul/g810-led.git synced 2024-12-23 01:06:11 +00:00

meson: Add a pkgconfig for libg810-led

This makes it much easier to link against libg810-led than manually
specifying compiler options, especially since in some cases you need to
pass extra cppflags.
This commit is contained in:
Dylan Baker 2020-05-07 14:59:57 -07:00
parent 04370a1dae
commit 69b70ee417

View File

@ -20,12 +20,12 @@ project(
default_options : ['cpp_std=gnu++11'],
)
extra_cpp_args = []
if get_option('usb') == 'hidapi'
dep_usb = dependency('hidapi-hidraw')
add_project_arguments('-Dhidapi', language : 'cpp')
extra_cpp_args = ['-Dhidapi']
else
dep_usb = dependency('libusb-1.0')
add_project_arguments('-Dlibusb', language : 'cpp')
endif
add_project_arguments(
@ -40,11 +40,19 @@ libg810_led = library(
[
'src/classes/Keyboard.cpp',
],
cpp_args : extra_cpp_args,
version : meson.project_version(),
dependencies : [dep_usb],
install : true,
)
pkg = import('pkgconfig')
pkg.generate(
libg810_led,
extra_cflags : extra_cpp_args,
description : 'library to control various logitech keyboard backlights',
)
g810_ld = executable(
meson.project_name(),
[