diff options
-rw-r--r-- | meson.build | 25 | ||||
-rw-r--r-- | tools/Makefile.am | 22 |
2 files changed, 28 insertions, 19 deletions
diff --git a/meson.build b/meson.build index 552f51e..6f4b4d8 100644 --- a/meson.build +++ b/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 ) diff --git a/tools/Makefile.am b/tools/Makefile.am index 85fe700..3f69d56 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -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 |