mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-20 04:30:06 +01:00
tools: Reinstate libshared.la and add it to meson.build too
Removed with commit 863fd1f0eb but now that we
exec each subcommand, the previous per-target compilation flags aren't needed
anymore. Build a static library to avoid rebuilding the source files for each
target.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
319db5b7df
commit
12a364a858
2 changed files with 28 additions and 19 deletions
25
meson.build
25
meson.build
|
|
@ -344,19 +344,28 @@ libinput_tool_path = join_paths(get_option('prefix'), get_option('libexecdir'),
|
|||
config_h.set_quoted('LIBINPUT_TOOL_PATH', libinput_tool_path)
|
||||
tools_shared_sources = [ 'tools/shared.c',
|
||||
'tools/shared.h' ]
|
||||
libinput_debug_events_sources = [ 'tools/libinput-debug-events.c' ] + tools_shared_sources
|
||||
deps_tools_shared = [ dep_libinput, dep_libevdev ]
|
||||
lib_tools_shared = static_library('tools_shared',
|
||||
tools_shared_sources,
|
||||
include_directories : include_directories('src'),
|
||||
dependencies : deps_tools_shared)
|
||||
dep_tools_shared = declare_dependency(link_with : lib_tools_shared,
|
||||
dependencies : deps_tools_shared)
|
||||
|
||||
deps_tools = [ dep_libinput, dep_tools_shared ]
|
||||
libinput_debug_events_sources = [ 'tools/libinput-debug-events.c' ]
|
||||
executable('libinput-debug-events',
|
||||
libinput_debug_events_sources,
|
||||
dependencies : dep_libinput,
|
||||
dependencies : deps_tools,
|
||||
include_directories : include_directories('src'),
|
||||
install_dir : libinput_tool_path,
|
||||
install : true
|
||||
)
|
||||
|
||||
libinput_list_devices_sources = [ 'tools/libinput-list-devices.c' ] + tools_shared_sources
|
||||
libinput_list_devices_sources = [ 'tools/libinput-list-devices.c' ]
|
||||
executable('libinput-list-devices',
|
||||
libinput_list_devices_sources,
|
||||
dependencies : [ dep_libinput ],
|
||||
dependencies : deps_tools,
|
||||
include_directories : include_directories('src'),
|
||||
install_dir : libinput_tool_path,
|
||||
install : true,
|
||||
|
|
@ -367,14 +376,12 @@ if get_option('debug-gui')
|
|||
dep_cairo = dependency('cairo')
|
||||
dep_glib = dependency('glib-2.0')
|
||||
|
||||
debug_gui_sources = [ 'tools/libinput-debug-gui.c' ] + tools_shared_sources
|
||||
debug_gui_sources = [ 'tools/libinput-debug-gui.c' ]
|
||||
deps_debug_gui = [
|
||||
dep_gtk,
|
||||
dep_cairo,
|
||||
dep_glib,
|
||||
dep_libevdev,
|
||||
dep_libinput
|
||||
]
|
||||
] + deps_tools
|
||||
executable('libinput-debug-gui',
|
||||
debug_gui_sources,
|
||||
dependencies : deps_debug_gui,
|
||||
|
|
@ -392,7 +399,7 @@ libinput_sources = [ 'tools/libinput-tool.c' ]
|
|||
|
||||
executable('libinput',
|
||||
libinput_sources,
|
||||
dependencies : dep_libinput,
|
||||
dependencies : deps_tools,
|
||||
include_directories : include_directories ('src'),
|
||||
install : true
|
||||
)
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ bin_PROGRAMS = libinput
|
|||
toolsdir = $(libexecdir)/libinput
|
||||
tools_PROGRAMS =
|
||||
bin_SCRIPTS = libinput-list-devices.compat libinput-debug-events.compat
|
||||
noinst_LTLIBRARIES = libshared.la
|
||||
|
||||
AM_CPPFLAGS = -I$(top_srcdir)/include \
|
||||
-I$(top_srcdir)/src \
|
||||
|
|
@ -10,9 +11,11 @@ AM_CPPFLAGS = -I$(top_srcdir)/include \
|
|||
AM_CFLAGS = $(GCC_CFLAGS)
|
||||
AM_CXXFLAGS = $(GCC_CXXFLAGS)
|
||||
|
||||
shared_sources = \
|
||||
shared.c \
|
||||
shared.h
|
||||
libshared_la_SOURCES = \
|
||||
shared.c \
|
||||
shared.h
|
||||
libshared_la_CFLAGS = $(AM_CFLAGS) $(LIBEVDEV_CFLAGS)
|
||||
libshared_la_LIBADD = $(LIBEVDEV_LIBS)
|
||||
|
||||
ptraccel_debug_SOURCES = ptraccel-debug.c
|
||||
ptraccel_debug_LDADD = ../src/libfilter.la ../src/libinput.la
|
||||
|
|
@ -20,29 +23,28 @@ ptraccel_debug_LDFLAGS = -no-install
|
|||
|
||||
libinput_SOURCES = \
|
||||
libinput-tool.c \
|
||||
libinput-tool.h \
|
||||
$(shared_sources)
|
||||
libinput_LDADD = ../src/libinput.la $(LIBUDEV_LIBS) $(LIBEVDEV_LIBS)
|
||||
libinput-tool.h
|
||||
libinput_LDADD = ../src/libinput.la libshared.la $(LIBUDEV_LIBS) $(LIBEVDEV_LIBS)
|
||||
libinput_CFLAGS = $(AM_CFLAGS) $(LIBUDEV_CFLAGS) $(LIBEVDEV_CFLAGS) \
|
||||
-DLIBINPUT_TOOL_PATH="\"@libexecdir@/libinput\""
|
||||
dist_man1_MANS = libinput.1
|
||||
|
||||
tools_PROGRAMS += libinput-list-devices
|
||||
libinput_list_devices_SOURCES = libinput-list-devices.c $(shared_sources)
|
||||
libinput_list_devices_LDADD = ../src/libinput.la $(LIBUDEV_LIBS) $(LIBEVDEV_LIBS)
|
||||
libinput_list_devices_LDADD = ../src/libinput.la libshared.la $(LIBUDEV_LIBS) $(LIBEVDEV_LIBS)
|
||||
libinput_list_devices_CFLAGS = $(AM_CFLAGS) $(LIBUDEV_CFLAGS) $(LIBEVDEV_CFLAGS)
|
||||
dist_man1_MANS += libinput-list-devices.1
|
||||
|
||||
tools_PROGRAMS += libinput-debug-events
|
||||
libinput_debug_events_SOURCES = libinput-debug-events.c $(shared_sources)
|
||||
libinput_debug_events_LDADD = ../src/libinput.la $(LIBUDEV_LIBS) $(LIBEVDEV_LIBS)
|
||||
libinput_debug_events_LDADD = ../src/libinput.la libshared.la $(LIBUDEV_LIBS) $(LIBEVDEV_LIBS)
|
||||
libinput_debug_events_CFLAGS = $(AM_CFLAGS) $(LIBUDEV_CFLAGS) $(LIBEVDEV_CFLAGS)
|
||||
dist_man1_MANS += libinput-debug-events.1
|
||||
|
||||
if BUILD_DEBUG_GUI
|
||||
tools_PROGRAMS += libinput-debug-gui
|
||||
libinput_debug_gui_SOURCES = libinput-debug-gui.c $(shared_sources)
|
||||
libinput_debug_gui_LDADD = ../src/libinput.la $(CAIRO_LIBS) $(GTK_LIBS) $(LIBEVDEV_LIBS)
|
||||
libinput_debug_gui_SOURCES = libinput-debug-gui.c
|
||||
libinput_debug_gui_LDADD = ../src/libinput.la libshared.la $(CAIRO_LIBS) $(GTK_LIBS) $(LIBEVDEV_LIBS)
|
||||
libinput_debug_gui_CFLAGS = $(AM_CFLAGS) $(CAIRO_CFLAGS) $(GTK_CFLAGS) $(LIBEVDEV_CFLAGS)
|
||||
dist_man1_MANS += libinput-debug-gui.1
|
||||
endif
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue