configh_data.set_quoted('DEFAULT_XKB_LAYOUT', get_option('default-layout'))
if get_option('default-variant') != ''
configh_data.set_quoted('DEFAULT_XKB_VARIANT', get_option('default-variant'))
+else
+ configh_data.set('DEFAULT_XKB_VARIANT', 'NULL')
endif
if get_option('default-options') != ''
configh_data.set_quoted('DEFAULT_XKB_OPTIONS', get_option('default-options'))
+else
+ configh_data.set('DEFAULT_XKB_OPTIONS', 'NULL')
endif
if cc.links('int main(){if(__builtin_expect(1<0,0)){}}', name: '__builtin_expect')
configh_data.set('HAVE___BUILTIN_EXPECT', 1)
)
endif
+# libxkbregistry
+if get_option('enable-xkbregistry')
+ dep_libxml = dependency('libxml-2.0')
+ deps_libxkbregistry = [dep_libxml]
+ libxkbregistry_sources = [
+ 'src/registry.c',
+ 'src/utils.h',
+ 'src/utils.c',
+ 'src/util-list.h',
+ 'src/util-list.c',
+ ]
+ libxkbregistry_link_args = []
+ if have_version_script
+ libxkbregistry_link_args += '-Wl,--version-script=' + join_paths(meson.source_root(), 'xkbregistry.map')
+ endif
+ libxkbregistry = library(
+ 'xkbregistry',
+ 'xkbcommon/xkbregistry.h',
+ libxkbregistry_sources,
+ link_args: libxkbregistry_link_args,
+ link_depends: 'xkbregistry.map',
+ dependencies: deps_libxkbregistry,
+ version: '0.0.0',
+ install: true,
+ include_directories: include_directories('src'),
+ )
+ install_headers(
+ 'xkbcommon/xkbregistry.h',
+ subdir: 'xkbcommon',
+ )
+ pkgconfig.generate(
+ name: 'xkbregistry',
+ filebase: 'xkbregistry',
+ libraries: libxkbregistry,
+ version: meson.project_version(),
+ description: 'XKB API to query available rules, models, layouts, variants and options',
+ )
+
+ dep_libxkbregistry = declare_dependency(
+ include_directories: include_directories('xkbcommon'),
+ link_with: libxkbregistry
+ )
+ executable('xkbcommon-registry-list',
+ 'tools/registry-list.c',
+ dependencies: dep_libxkbregistry,
+ install: false)
+endif
# Tests
test_env = environment()
# See: https://github.com/xkbcommon/libxkbcommon/issues/30
executable('test-x11comp', 'test/x11comp.c', dependencies: x11_test_dep)
endif
-
+if get_option('enable-xkbregistry')
+ test(
+ 'registry',
+ executable('test-registry', 'test/registry.c',
+ include_directories: include_directories('src'),
+ dependencies: dep_libxkbregistry),
+ env: test_env,
+ )
+endif
# Fuzzing target programs.
executable('fuzz-keymap', 'fuzz/keymap/target.c', dependencies: test_dep)
)
if cc.has_header_symbol('getopt.h', 'getopt_long', prefix: '#define _GNU_SOURCE')
- executable('xkbcommon-rmlvo-to-kccgst', 'tools/rmlvo-to-kccgst.c', dependencies: tools_dep)
executable('xkbcommon-rmlvo-to-keymap', 'tools/rmlvo-to-keymap.c', dependencies: tools_dep)
- executable('xkbcommon-print-compiled-keymap', 'tools/print-compiled-keymap.c', dependencies: tools_dep)
executable('xkbcommon-how-to-type', 'tools/how-to-type.c', dependencies: tools_dep)
endif
if cc.has_header('linux/input.h')
'xkbcommon/xkbcommon-names.h',
'xkbcommon/xkbcommon-x11.h',
'xkbcommon/xkbcommon-compose.h',
+ 'xkbcommon/xkbregistry.h',
]
doxygen_data = configuration_data()
doxygen_data.set('PACKAGE_NAME', meson.project_name())