build: Migrate includes to use libx52/ prefix

As part of the refactor, have the sources include the public headers via
the libx52 prefix, instead of relying on the include directories
approach in meson.build
pull/66/head
nirenjan 2026-04-03 22:54:48 -07:00
parent 9c47e78fc5
commit 9c1eaaa4b2
43 changed files with 50 additions and 44 deletions

1
.gitignore vendored
View File

@ -14,6 +14,7 @@ libx52util/util_char_map.c
udev/*.rules
x52d*
!daemon/x52d*.*
!libx52/x52dcomm.h
test-*
libx52-*.tar.gz

View File

@ -1021,7 +1021,9 @@ EXCLUDE_SYMLINKS = NO
# Note that the wildcards are matched against the file with absolute path, so to
# exclude all test directories for example use the pattern */test/*
EXCLUDE_PATTERNS =
EXCLUDE_PATTERNS = */libx52/libx52io.h \
*/libx52/libx52util.h \
*/libx52/x52dcomm.h
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
# (namespaces, classes, functions, etc.) that should be excluded from the

View File

@ -14,7 +14,7 @@
#include "libusb.h"
#include "hidapi.h"
#include "libx52io.h"
#include <libx52/libx52io.h>
#include "version-info.h"
static void print_sysinfo(void)

View File

@ -12,7 +12,7 @@
#include <setjmp.h>
#include <cmocka.h>
#include "libx52.h"
#include <libx52/libx52.h>
extern int run_main(int argc, char **argv);

View File

@ -158,7 +158,7 @@ possibly through \b sudo(8)
#include <unistd.h>
#include <time.h>
#include "libx52.h"
#include <libx52/libx52.h>
struct string_map {
const char *key;

View File

@ -49,7 +49,7 @@ string "quit", or terminates input by using Ctrl+D.
#include <errno.h>
#include "x52d_const.h"
#include "x52dcomm.h"
#include <libx52/x52dcomm.h>
#define APP_NAME "x52ctl"
#if HAVE_FUNC_ATTRIBUTE_NORETURN

View File

@ -15,7 +15,7 @@
#include <sys/un.h>
#include <unistd.h>
#include "x52dcomm.h"
#include <libx52/x52dcomm.h>
#include "x52dcomm-internal.h"
static int _setup_socket(struct sockaddr_un *remote, int len)

View File

@ -12,7 +12,7 @@
#include <stdint.h>
#include <stdbool.h>
#include <limits.h>
#include "libx52.h"
#include <libx52/libx52.h>
/**
* @brief Configuration structure

View File

@ -16,7 +16,7 @@
#define PINELOG_MODULE X52D_MOD_CONFIG
#include "pinelog.h"
#include "libx52.h"
#include <libx52/libx52.h>
#include "x52d_config.h"
#include "x52d_const.h"

View File

@ -16,7 +16,7 @@
#include "x52d_config.h"
#include "x52d_device.h"
#include "x52d_notify.h"
#include "libx52.h"
#include <libx52/libx52.h>
#include "pinelog.h"
static libx52_device *x52_dev;

View File

@ -9,7 +9,7 @@
#ifndef X52D_DEVICE_H
#define X52D_DEVICE_H
#include "libx52.h"
#include <libx52/libx52.h>
void x52d_dev_init(void);
void x52d_dev_exit(void);

View File

@ -15,7 +15,7 @@
#include "x52d_config.h"
#include "x52d_io.h"
#include "x52d_mouse.h"
#include "libx52io.h"
#include <libx52/libx52io.h>
#define PINELOG_MODULE X52D_MOD_IO
#include "pinelog.h"

View File

@ -26,7 +26,7 @@
#include "x52d_command.h"
#include "x52d_notify.h"
#include "x52dcomm-internal.h"
#include "x52dcomm.h"
#include <libx52/x52dcomm.h>
#include "pinelog.h"
static volatile int flag_quit;

View File

@ -10,7 +10,7 @@
#define X52D_MOUSE_H
#include <stdbool.h>
#include "libx52io.h"
#include <libx52/libx52io.h>
extern volatile bool mouse_isometric_mode;
extern volatile int mouse_scroll_dir;

View File

@ -13,8 +13,8 @@
#include <unistd.h>
#include <math.h>
#include "libx52io.h"
#include "vkm.h"
#include <libx52/libx52io.h>
#include <vkm/vkm.h>
#define PINELOG_MODULE X52D_MOD_MOUSE
#include "pinelog.h"

View File

@ -16,7 +16,7 @@
#include "x52d_const.h"
#include "x52d_notify.h"
#include "x52d_client.h"
#include "x52dcomm.h"
#include <libx52/x52dcomm.h>
#include "x52dcomm-internal.h"
static pthread_t notify_thr;

View File

@ -11,7 +11,7 @@ to a supported joystick. This function must be called after \ref libx52_init
<b>Example Initialization/Deinitialization Code</b>
@code{.c}
#include <libx52.h>
#include <libx52/libx52.h>
libx52_device* init_libx52(void)
{

View File

@ -45,10 +45,10 @@ with your application.
See the documentation for the following files for a complete list of all
functions.
- libx52.h
- libx52io.h
- libx52util.h
- vkm.h
- x52dcomm.h
- libx52/libx52.h
- libx52/libx52io.h
- libx52/libx52util.h
- vkm/vkm.h
- libx52/x52dcomm.h
*/

View File

@ -17,7 +17,7 @@
#include <time.h>
#include <sys/time.h>
#include "libx52io.h"
#include <libx52/libx52io.h>
#include "gettext.h"
/*

View File

@ -15,7 +15,7 @@
#include <locale.h>
#include <time.h>
#include "libx52.h"
#include <libx52/libx52.h>
#include "x52_test_common.h"
libx52_device *dev;
int test_exit;

View File

@ -13,7 +13,7 @@
#include <unistd.h>
#include <time.h>
#include "libx52.h"
#include <libx52/libx52.h>
#include "x52_test_common.h"
int test_clock(void)

View File

@ -12,7 +12,7 @@
#include "config.h"
#include <stdio.h>
#include <stdbool.h>
#include "libx52.h"
#include <libx52/libx52.h>
#include "gettext.h"
extern libx52_device *dev;

View File

@ -12,7 +12,7 @@
#include <string.h>
#include <unistd.h>
#include "libx52.h"
#include <libx52/libx52.h>
#include "x52_test_common.h"
#define TEST_LED(name, state) do { \

View File

@ -12,7 +12,7 @@
#include <string.h>
#include <unistd.h>
#include "libx52.h"
#include <libx52/libx52.h>
#include "x52_test_common.h"
#define TEST_BRIGHTNESS(mfd, value) TEST(brightness, mfd, value)

View File

@ -0,0 +1 @@
../libx52io/libx52io.h

View File

@ -0,0 +1 @@
../libx52util/libx52util.h

View File

@ -13,7 +13,7 @@
#include <stdio.h>
#include <string.h>
#include "libx52.h"
#include <libx52/libx52.h>
#define TEST_STRINGIFY(name) do { \
char expected[256]; \

View File

@ -12,7 +12,7 @@
#include <stdint.h>
#include <stdlib.h>
#include <libusb.h>
#include "libx52.h"
#include <libx52/libx52.h>
/*
* The X52 MFD supports the following:

View File

@ -13,7 +13,7 @@
#include <errno.h>
#include <string.h>
#include "libx52.h"
#include <libx52/libx52.h>
#include "x52_commands.h"
#include "x52_common.h"

View File

@ -14,7 +14,7 @@
#include <string.h>
#include "usb-ids.h"
#include "libx52.h"
#include <libx52/libx52.h>
#include "x52_commands.h"
#include "x52_common.h"
#include "gettext.h"

View File

@ -14,7 +14,7 @@
#include <errno.h>
#include <string.h>
#include "libx52.h"
#include <libx52/libx52.h>
#include "x52_commands.h"
#include "x52_common.h"

View File

@ -9,7 +9,7 @@
#include "config.h"
#include <stdio.h>
#include "libx52.h"
#include <libx52/libx52.h>
#include "gettext.h"
#define N_(str) gettext_noop(str)

View File

@ -9,7 +9,7 @@
#include "config.h"
#include <stdio.h>
#include "libx52.h"
#include <libx52/libx52.h>
#include "gettext.h"
#define N_(str) gettext_noop(str)

View File

@ -0,0 +1 @@
../daemon/x52dcomm.h

View File

@ -10,7 +10,7 @@
#define IO_COMMON_H
#include <stdint.h>
#include "libx52io.h"
#include <libx52/libx52io.h>
#include "hidapi.h"
// Function handler for parsing reports

View File

@ -9,7 +9,7 @@
#include "config.h"
#include <stdio.h>
#include <string.h>
#include "libx52io.h"
#include <libx52/libx52io.h>
#include "gettext.h"
/* The strings corresponding to the axis and button enumerations are

View File

@ -11,7 +11,7 @@
#include <setjmp.h>
#include <cmocka.h>
#include "libx52io.h"
#include <libx52/libx52io.h>
static void lower_ascii_only(char *dst, const char *src)
{

View File

@ -14,7 +14,7 @@
#include <string.h>
#include <errno.h>
#include "libx52util.h"
#include <libx52/libx52util.h>
#include "x52_char_map.h"
/**

View File

@ -16,7 +16,7 @@
#include <time.h>
#include <unistd.h>
#include "libx52util.h"
#include <libx52/libx52util.h>
// Fix this if we ever hit longer sequences
#define RECORD_SIZE 8

View File

@ -120,7 +120,7 @@ dep_inih = dependency('inih')
# Shared libraries and programs
#######################################################################
# Includes
includes = include_directories('.', 'libx52', 'libx52io', 'libx52util', 'vkm')
includes = include_directories('.')
subdir('libx52')
subdir('libx52io')

View File

@ -13,7 +13,7 @@
#include <stdio.h>
#include <string.h>
#include "vkm.h"
#include <vkm/vkm.h>
static void test_strerror(void **state)
{

View File

@ -7,7 +7,7 @@
*/
#include <stdbool.h>
#include "vkm.h"
#include <vkm/vkm.h>
#ifndef VKM_INTERNAL_H
#define VKM_INTERNAL_H

View File

@ -9,7 +9,7 @@
#include <stdlib.h>
#include <stdarg.h>
#include "vkm.h"
#include <vkm/vkm.h>
struct vkm_context {
bool started;