meson: always include config.h first, use -include

Seems like we've (tried) to fix this in the past, although it crept in
again. Just use a compiler directive and drop the error prone individual
includes.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
This commit is contained in:
Emil Velikov 2024-09-18 20:20:29 +01:00
parent 5ceedcf384
commit 5d14ff7127
12 changed files with 3 additions and 20 deletions

View File

@ -5,8 +5,6 @@
* Copyright (C) 2017-2018 Michael Drake <michael.drake@codethink.co.uk>
*/
#include "config.h"
#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>

View File

@ -5,8 +5,6 @@
* Copyright (C) 2017-2018 Michael Drake <michael.drake@codethink.co.uk>
*/
#include "config.h"
#include <stdbool.h>
#include <assert.h>
#include <string.h>

View File

@ -6,7 +6,6 @@
* Copyright (C) 2003-2005 David Brownell
*/
#include "config.h"
#include <stdint.h>
#include <sys/stat.h>
#include <fcntl.h>

View File

@ -29,7 +29,9 @@ cc = meson.get_compiler('c')
config = configuration_data()
config.set_quoted('PACKAGE_NAME', meson.project_name())
config.set_quoted('VERSION', meson.project_version())
configure_file(output: 'config.h', configuration: config)
config_h = configure_file(output: 'config.h', configuration: config)
add_project_arguments('-include', 'config.h', language : 'c')
# Build usbhid-dump in a subdir
subdir('usbhid-dump')

View File

@ -20,7 +20,6 @@
#include <libusb.h>
#include <libudev.h>
#include "config.h"
#include "usb-spec.h"
#include "names.h"
#include "sysfs.h"

View File

@ -5,8 +5,6 @@
* Copyright (C) 2010 Nikolai Kondrashov <spbnick@gmail.com>
*/
#include "config.h"
#include "dev.h"
#include <assert.h>
#include <stdlib.h>

View File

@ -5,8 +5,6 @@
* Copyright (C) 2010 Nikolai Kondrashov <spbnick@gmail.com>
*/
#include "config.h"
#include "misc.h"
#include "dev_list.h"
#include <assert.h>

View File

@ -5,8 +5,6 @@
* Copyright (C) 2010 Nikolai Kondrashov <spbnick@gmail.com>
*/
#include "config.h"
#include "iface.h"
#include <assert.h>
#include <stdlib.h>

View File

@ -5,8 +5,6 @@
* Copyright (C) 2010 Nikolai Kondrashov <spbnick@gmail.com>
*/
#include "config.h"
#include "iface_list.h"
#include "misc.h"
#include <assert.h>

View File

@ -1,8 +1,6 @@
# SPDX-License-Identifier: GPL-2.0-only
# Copyright (c) 2024 Greg Kroah-Hartman <gregkh@linuxfoundation.org>
configure_file(output: 'config.h', configuration: config)
sources = [
'dev.c',
'dev.h',

View File

@ -5,8 +5,6 @@
* Copyright (C) 2010-2011 Nikolai Kondrashov <spbnick@gmail.com>
*/
#include "config.h"
#include "iface_list.h"
#include "misc.h"
#include <libusb.h>

View File

@ -12,7 +12,6 @@
#include <iconv.h>
#include <langinfo.h>
#include "config.h"
#include "usbmisc.h"
/* ---------------------------------------------------------------------- */