Commit 6c629a10cf2899125a6cbd2c723ed7a3185fad6d

Peter Hutterer 2020-06-23T15:56:16

Use a custom internal library for the tools This is currently identical to the internal test library, but it's a start to disentangle the two. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

diff --git a/meson.build b/meson.build
index 2033000..b06cb8e 100644
--- a/meson.build
+++ b/meson.build
@@ -443,11 +443,21 @@ executable('fuzz-compose', 'fuzz/compose/target.c', dependencies: test_dep)
 
 
 # Demo programs.
+libxkbcommon_tools_internal = static_library(
+    'tools-internal',
+    libxkbcommon_sources,
+    include_directories: include_directories('src'),
+)
+tools_dep = declare_dependency(
+    include_directories: include_directories('src'),
+    link_with: libxkbcommon_tools_internal,
+)
+
 if cc.has_header_symbol('getopt.h', 'getopt_long', prefix: '#define _GNU_SOURCE')
-    executable('rmlvo-to-kccgst', 'tools/rmlvo-to-kccgst.c', dependencies: test_dep)
-    executable('rmlvo-to-keymap', 'tools/rmlvo-to-keymap.c', dependencies: test_dep)
-    executable('print-compiled-keymap', 'tools/print-compiled-keymap.c', dependencies: test_dep)
-    executable('how-to-type', 'tools/how-to-type.c', dependencies: test_dep)
+    executable('rmlvo-to-kccgst', 'tools/rmlvo-to-kccgst.c', dependencies: tools_dep)
+    executable('rmlvo-to-keymap', 'tools/rmlvo-to-keymap.c', dependencies: tools_dep)
+    executable('print-compiled-keymap', 'tools/print-compiled-keymap.c', dependencies: tools_dep)
+    executable('how-to-type', 'tools/how-to-type.c', dependencies: tools_dep)
 endif
 if cc.has_header('linux/input.h')
     executable('interactive-evdev', 'test/interactive-evdev.c', dependencies: test_dep)