Skip to content

Commit 34ef967

Browse files
committed
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.
1 parent 7acf74a commit 34ef967

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

meson.build

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ project(
2020
default_options : ['cpp_std=gnu++11'],
2121
)
2222

23+
extra_cpp_args = []
2324
if get_option('usb') == 'hidapi'
2425
dep_usb = dependency('hidapi-hidraw')
25-
add_project_arguments('-Dhidapi', language : 'cpp')
26+
extra_cpp_args = ['-Dhidapi']
2627
else
2728
dep_usb = dependency('libusb-1.0')
28-
add_project_arguments('-Dlibusb', language : 'cpp')
2929
endif
3030

3131
add_project_arguments(
@@ -40,11 +40,19 @@ libg810_led = library(
4040
[
4141
'src/classes/Keyboard.cpp',
4242
],
43+
cpp_args : extra_cpp_args,
4344
version : meson.project_version(),
4445
dependencies : [dep_usb],
4546
install : true,
4647
)
4748

49+
pkg = import('pkgconfig')
50+
pkg.generate(
51+
libg810_led,
52+
extra_cflags : extra_cpp_args,
53+
description : 'library to control various logitech keyboard backlights',
54+
)
55+
4856
g810_ld = executable(
4957
meson.project_name(),
5058
[

0 commit comments

Comments
 (0)