|
|
73b847 |
From 130466c3c9cceae69b41dfb6c474d4d474722426 Mon Sep 17 00:00:00 2001
|
|
|
73b847 |
From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= <mail@3v1n0.net>
|
|
|
73b847 |
Date: Wed, 4 Dec 2019 13:44:08 +0100
|
|
|
73b847 |
Subject: [PATCH 084/181] meson: Move generated source to fpi- prefix and use
|
|
|
73b847 |
more readable code
|
|
|
73b847 |
|
|
|
73b847 |
Instead of concatenating strings, use an array of strings and finally join
|
|
|
73b847 |
them using newline.
|
|
|
73b847 |
---
|
|
|
73b847 |
libfprint/meson.build | 4 ++--
|
|
|
73b847 |
meson.build | 19 +++++++++++++------
|
|
|
73b847 |
2 files changed, 15 insertions(+), 8 deletions(-)
|
|
|
73b847 |
|
|
|
73b847 |
diff --git a/libfprint/meson.build b/libfprint/meson.build
|
|
|
73b847 |
index 99ebf73..f73aba3 100644
|
|
|
73b847 |
--- a/libfprint/meson.build
|
|
|
73b847 |
+++ b/libfprint/meson.build
|
|
|
73b847 |
@@ -172,11 +172,11 @@ fpi_enums = gnome.mkenums_simple('fpi-enums',
|
|
|
73b847 |
fpi_enums_h = fpi_enums[1]
|
|
|
73b847 |
|
|
|
73b847 |
drivers_sources += configure_file(input: 'empty_file',
|
|
|
73b847 |
- output: 'fp-drivers.c',
|
|
|
73b847 |
+ output: 'fpi-drivers.c',
|
|
|
73b847 |
capture: true,
|
|
|
73b847 |
command: [
|
|
|
73b847 |
'echo',
|
|
|
73b847 |
- drivers_type_list + '\n\n' + drivers_type_func
|
|
|
73b847 |
+ '\n'.join(drivers_type_list + [] + drivers_type_func)
|
|
|
73b847 |
])
|
|
|
73b847 |
|
|
|
73b847 |
mapfile = 'libfprint.ver'
|
|
|
73b847 |
diff --git a/meson.build b/meson.build
|
|
|
73b847 |
index 265ce30..65077c5 100644
|
|
|
73b847 |
--- a/meson.build
|
|
|
73b847 |
+++ b/meson.build
|
|
|
73b847 |
@@ -117,15 +117,22 @@ foreach driver: drivers
|
|
|
73b847 |
endforeach
|
|
|
73b847 |
|
|
|
73b847 |
# Export the drivers' types to the core code
|
|
|
73b847 |
-drivers_type_list = '#include <glib-object.h>\n'
|
|
|
73b847 |
-drivers_type_list += '#include "fpi-context.h"\n'
|
|
|
73b847 |
-drivers_type_func = 'void fpi_get_driver_types(GArray *drivers)\n{\n\tGType t;\n'
|
|
|
73b847 |
+drivers_type_list = []
|
|
|
73b847 |
+drivers_type_func = []
|
|
|
73b847 |
+drivers_type_list += '#include <glib-object.h>'
|
|
|
73b847 |
+drivers_type_list += '#include "fpi-context.h"'
|
|
|
73b847 |
+drivers_type_list += ''
|
|
|
73b847 |
+drivers_type_func += 'void fpi_get_driver_types (GArray *drivers)'
|
|
|
73b847 |
+drivers_type_func += ' {'
|
|
|
73b847 |
+drivers_type_func += ' GType t;'
|
|
|
73b847 |
+drivers_type_func += ''
|
|
|
73b847 |
foreach driver: drivers
|
|
|
73b847 |
- drivers_type_list += 'extern GType (fpi_device_' + driver + '_get_type) (void);\n'
|
|
|
73b847 |
- drivers_type_func += ' t = fpi_device_' + driver + '_get_type(); g_array_append_val (drivers, t);\n'
|
|
|
73b847 |
+ drivers_type_list += 'extern GType (fpi_device_' + driver + '_get_type) (void);'
|
|
|
73b847 |
+ drivers_type_func += ' t = fpi_device_' + driver + '_get_type ();'
|
|
|
73b847 |
+ drivers_type_func += ' g_array_append_val (drivers, t);\n'
|
|
|
73b847 |
endforeach
|
|
|
73b847 |
drivers_type_list += ''
|
|
|
73b847 |
-drivers_type_func += '};'
|
|
|
73b847 |
+drivers_type_func += '}'
|
|
|
73b847 |
|
|
|
73b847 |
root_inc = include_directories('.')
|
|
|
73b847 |
|
|
|
73b847 |
--
|
|
|
73b847 |
2.24.1
|
|
|
73b847 |
|