Skip to content

Commit

Permalink
meson: Add a pkgconfig for libg810-led
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dcbaker committed May 7, 2020
1 parent 7acf74a commit 34ef967
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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(),
[
Expand Down

0 comments on commit 34ef967

Please sign in to comment.