[gnome-builder] libide-io: generate enums and cleanup include header



commit 83110d118500d20fa6e720c390784d6b2e0084f7
Author: Christian Hergert <chergert redhat com>
Date:   Mon Jul 11 16:44:10 2022 -0700

    libide-io: generate enums and cleanup include header

 src/libide/io/libide-io.h | 23 +++++++++++------------
 src/libide/io/meson.build | 28 +++++++++++++++++++++++++---
 2 files changed, 36 insertions(+), 15 deletions(-)
---
diff --git a/src/libide/io/libide-io.h b/src/libide/io/libide-io.h
index 415fac5e2..13e7a67c1 100644
--- a/src/libide/io/libide-io.h
+++ b/src/libide/io/libide-io.h
@@ -27,22 +27,21 @@ G_BEGIN_DECLS
 
 #define IDE_IO_INSIDE
 # include "ide-cached-list-model.h"
-
-#include "ide-content-type.h"
-#include "ide-gfile.h"
-#include "ide-line-reader.h"
-#include "ide-marked-content.h"
-#include "ide-path.h"
-#include "ide-persistent-map-builder.h"
-#include "ide-persistent-map.h"
-#include "ide-pkcon-transfer.h"
-#include "ide-pty-intercept.h"
-#include "ide-shell.h"
-
+# include "ide-content-type.h"
 # include "ide-directory-reaper.h"
 # include "ide-file-transfer.h"
+# include "ide-gfile.h"
 # include "ide-heap.h"
+# include "ide-line-reader.h"
+# include "ide-io-enums.h"
+# include "ide-marked-content.h"
+# include "ide-path.h"
+# include "ide-persistent-map-builder.h"
+# include "ide-persistent-map.h"
+# include "ide-pkcon-transfer.h"
+# include "ide-pty-intercept.h"
 # include "ide-recursive-file-monitor.h"
+# include "ide-shell.h"
 # include "ide-task-cache.h"
 #undef IDE_IO_INSIDE
 
diff --git a/src/libide/io/meson.build b/src/libide/io/meson.build
index 6ddc41801..1f726cd1e 100644
--- a/src/libide/io/meson.build
+++ b/src/libide/io/meson.build
@@ -1,3 +1,4 @@
+libide_io_header_dir = join_paths(libide_header_dir, 'io')
 libide_io_header_subdir = join_paths(libide_header_subdir, 'io')
 libide_include_directories += include_directories('.')
 
@@ -55,8 +56,28 @@ libide_io_public_sources = [
   'ide-task-cache.c',
 ]
 
+libide_io_generated_headers = []
 libide_io_sources = libide_io_public_sources
 
+#
+# Enum generation
+#
+
+libide_io_enum_headers = [
+  'ide-file-transfer.h',
+]
+
+libide_io_enums = gnome.mkenums_simple('ide-io-enums',
+     body_prefix: '#include "config.h"',
+   header_prefix: '#include <libide-core.h>',
+       decorator: '_IDE_EXTERN',
+         sources: libide_io_enum_headers,
+  install_header: true,
+     install_dir: libide_io_header_dir,
+)
+libide_io_generated_headers += [libide_io_enums[1]]
+libide_io_sources += [libide_io_enums[0]]
+
 #
 # Dependencies
 #
@@ -71,9 +92,10 @@ libide_io_deps = [
 # Library Definitions
 #
 
-libide_io = static_library('ide-io-' + libide_api_version, libide_io_sources,
-   dependencies: libide_io_deps,
-         c_args: libide_args + release_args + ['-DIDE_IO_COMPILATION'],
+libide_io = static_library('ide-io-' + libide_api_version,
+  libide_io_sources + libide_io_generated_headers,
+  dependencies: libide_io_deps,
+        c_args: libide_args + release_args + ['-DIDE_IO_COMPILATION'],
 )
 
 libide_io_dep = declare_dependency(


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]