[libadwaita/zbrown/enums] enums: let mkenums use the standard template




commit 872d942930fe72f45410a2a64155c3df2be94a0c
Author: Zander Brown <zbrown gnome org>
Date:   Fri Nov 12 10:15:01 2021 +0000

    enums: let mkenums use the standard template
    
    We don't need to do anything fancy and the manually written file-header
    section was causing confusion when adding new enums

 src/adw-enums-private.c.in | 39 ---------------------------------------
 src/adw-enums-private.h.in | 27 ---------------------------
 src/adw-enums.c.in         | 46 ----------------------------------------------
 src/adw-enums.h.in         | 28 ----------------------------
 src/meson.build            | 23 ++++++++++++++++-------
 5 files changed, 16 insertions(+), 147 deletions(-)
---
diff --git a/src/meson.build b/src/meson.build
index 35f3d905..27d68eeb 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -50,23 +50,32 @@ libadwaita_public_headers = []
 libadwaita_public_sources = []
 libadwaita_private_sources = []
 
-adw_public_enums = gnome.mkenums('adw-enums',
-      h_template: 'adw-enums.h.in',
-      c_template: 'adw-enums.c.in',
+adw_public_enums = gnome.mkenums_simple('adw-enums',
          sources: adw_public_enum_headers,
+     body_prefix: '#include "config.h"',
+   header_prefix: '#if !defined(_ADWAITA_INSIDE) && !defined(ADWAITA_COMPILATION)\n' +
+                  '#error "Only <adwaita.h> can be included directly."\n' +
+                  '#endif\n' +
+                  '\n' +
+                  '#include "adw-version.h"\n',
+       decorator: 'ADW_AVAILABLE_IN_ALL',
   install_header: true,
      install_dir: libadwaita_header_dir,
 )
 
-adw_private_enums = gnome.mkenums('adw-enums-private',
-      h_template: 'adw-enums-private.h.in',
-      c_template: 'adw-enums-private.c.in',
+adw_private_enums = gnome.mkenums_simple('adw-enums-private',
          sources: adw_private_enum_headers,
+     body_prefix: '#include "config.h"',
+   header_prefix: '#if !defined(_ADWAITA_INSIDE) && !defined(ADWAITA_COMPILATION)\n' +
+                  '#error "Only <adwaita.h> can be included directly."\n' +
+                  '#endif\n' +
+                  '\n' +
+                  '#include "adw-enums.h"\n',
   install_header: false,
 )
 
 libadwaita_public_sources += [adw_public_enums[0]]
-libadwaita_private_sources += [adw_private_enums[0]]
+libadwaita_private_sources += adw_private_enums
 libadwaita_generated_headers += [adw_public_enums[1]]
 
 src_headers = [


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