1
0
mirror of https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git synced 2026-10-24 00:48:53 +03:00
Files
libgpiod/tools/meson.build
Bartosz Golaszewski 0fe66719dd tools: reuse libgpiotools
Reuse as much of the functionality provided by the new libgpiotools
shared library in tools-common while retaining the functions used to
validate command-line arguments, print help text or bail-out on errors.
We keep the existing interfaces to gpio-tools and use them to wrap the
API exposed by libgpiotools as we want to keep bailing out on errors
without requiring tools to do a lot of repeated error checking.

Acked-by: Kent Gibson <warthog618@gmail.com>
Link: https://patch.msgid.link/20260513-tools-common-shared-lib-v1-2-58ac28a9f1d5@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
2026-05-18 10:35:51 +02:00

59 lines
1.6 KiB
Meson

# SPDX-License-Identifier: GPL-2.0-or-later
# SPDX-FileCopyrightText: 2026 Qualcomm Technologies, Inc. and/or its subsidiaries
libgpiotools_lib = library('gpiotools',
sources: ['gpiotools.c'],
include_directories: libgpiod_inc,
c_args: ['-fvisibility=hidden'],
dependencies: [libgpiod_dep],
version: libgpiotools_version,
soversion: libgpiotools_soversion,
install: true,
)
install_headers('gpiotools.h')
pkgconfig = import('pkgconfig')
pkgconfig.generate(libgpiotools_lib,
name: 'libgpiotools',
description: 'Collection of high-level functions for building programs using libgpiod',
url: project_url,
version: meson.project_version(),
)
libgpiotools_dep = declare_dependency(
link_with: libgpiotools_lib,
include_directories: include_directories('.'),
)
tools_common_lib = static_library('tools-common',
sources: ['tools-common.c'],
include_directories: libgpiod_inc,
dependencies: [libgpiotools_dep],
pic: true,
)
tools_common_dep = declare_dependency(
link_with: tools_common_lib,
include_directories: include_directories('.'),
)
tools_c_args = []
tools_deps = [libgpiod_dep, libgpiotools_dep, tools_common_dep]
if opt_gpioset_interactive.allowed() and libedit_dep.found()
tools_c_args += ['-DGPIOSET_INTERACTIVE']
tools_deps += [libedit_dep]
endif
tools_exes = {}
foreach tool : ['gpiodetect', 'gpioinfo', 'gpioget', 'gpioset', 'gpiomon', 'gpionotify']
tools_exes += {tool: executable(tool,
sources: [tool + '.c'],
include_directories: libgpiod_inc,
dependencies: tools_deps,
c_args: tools_c_args,
install: true,
)}
endforeach