Skip to content

Commit

Permalink
Split utility functions into separate source files
Browse files Browse the repository at this point in the history
libinput-util.h is getting a bit of a catchall bucket and it includes things
like libinput-private.h which in turn includes libwacom. This makes
libinput-util.h less useful for bits that only need e.g. the string processing
utilities.

So let's split them all up in to separate files, to be used as-needed.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
  • Loading branch information
whot committed Sep 11, 2019
1 parent 00f3345 commit c84366e
Show file tree
Hide file tree
Showing 16 changed files with 1,270 additions and 898 deletions.
42 changes: 38 additions & 4 deletions meson.build
Expand Up @@ -218,9 +218,45 @@ else
endif

############ libinput-util.a ############

# Basic compilation test to make sure the headers include and define all the
# necessary bits.
util_headers = [
'util-bits.h',
'util-list.h',
'util-macros.h',
'util-matrix.h',
'util-prop-parsers.h',
'util-ratelimit.h',
'util-strings.h',
'util-time.h',
]
foreach h: util_headers
c = configuration_data()
c.set_quoted('FILE', h)
testfile = configure_file(input : 'test/test-util-includes.c',
output : 'test-util-includes-@0@.c'.format(h),
configuration : c)
executable('test-build-@0@'.format(h),
testfile, join_paths(dir_src, h),
include_directories : [includes_src, includes_include],
install : false)
endforeach

src_libinput_util = [
'src/libinput-util.c',
'src/libinput-util.h'
'src/util-bits.h',
'src/util-list.c',
'src/util-list.h',
'src/util-macros.h',
'src/util-matrix.h',
'src/util-ratelimit.c',
'src/util-ratelimit.h',
'src/util-strings.h',
'src/util-strings.c',
'src/util-time.h',
'src/util-prop-parsers.h',
'src/util-prop-parsers.c',
'src/libinput-util.h',
]
libinput_util = static_library('libinput-util',
src_libinput_util,
Expand Down Expand Up @@ -836,7 +872,6 @@ if get_option('tests')

test_utils_sources = [
'src/libinput-util.h',
'src/libinput-util.c',
'test/test-utils.c',
]
test_utils = executable('test-utils',
Expand All @@ -850,7 +885,6 @@ if get_option('tests')

libinput_test_runner_sources = litest_sources + [
'src/libinput-util.h',
'src/libinput-util.c',
'test/test-udev.c',
'test/test-path.c',
'test/test-pointer.c',
Expand Down

0 comments on commit c84366e

Please sign in to comment.