mirror of
https://github.com/MatMoul/g810-led.git
synced 2024-12-23 09:16: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:
parent
04370a1dae
commit
69b70ee417
12
meson.build
12
meson.build
@ -20,12 +20,12 @@ project(
|
|||||||
default_options : ['cpp_std=gnu++11'],
|
default_options : ['cpp_std=gnu++11'],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
extra_cpp_args = []
|
||||||
if get_option('usb') == 'hidapi'
|
if get_option('usb') == 'hidapi'
|
||||||
dep_usb = dependency('hidapi-hidraw')
|
dep_usb = dependency('hidapi-hidraw')
|
||||||
add_project_arguments('-Dhidapi', language : 'cpp')
|
extra_cpp_args = ['-Dhidapi']
|
||||||
else
|
else
|
||||||
dep_usb = dependency('libusb-1.0')
|
dep_usb = dependency('libusb-1.0')
|
||||||
add_project_arguments('-Dlibusb', language : 'cpp')
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
add_project_arguments(
|
add_project_arguments(
|
||||||
@ -40,11 +40,19 @@ libg810_led = library(
|
|||||||
[
|
[
|
||||||
'src/classes/Keyboard.cpp',
|
'src/classes/Keyboard.cpp',
|
||||||
],
|
],
|
||||||
|
cpp_args : extra_cpp_args,
|
||||||
version : meson.project_version(),
|
version : meson.project_version(),
|
||||||
dependencies : [dep_usb],
|
dependencies : [dep_usb],
|
||||||
install : true,
|
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(
|
g810_ld = executable(
|
||||||
meson.project_name(),
|
meson.project_name(),
|
||||||
[
|
[
|
||||||
|
Loading…
Reference in New Issue
Block a user