birb/birb

Fix a number of issues in the build

4 months ago, Gary Kramlich
a39448f829f9
Parents 42f710f0a958
Children 6938f7dbd994
Fix a number of issues in the build

Moved enum generation before the global header because the global header uses
the enum header file.

Add the gir file as a source for the dependency object so our dependencies will work with our gir file.

Add a library version.

Add the built targets to the gir file.

Testing Done:
Compiled without issue. Also compiled a Pidgin branch I'm working on without issue.

Reviewed at https://reviews.imfreedom.org/r/2917/
--- a/birb/meson.build Tue Jan 16 22:56:20 2024 -0600
+++ b/birb/meson.build Thu Jan 18 23:59:08 2024 -0600
@@ -1,3 +1,5 @@
+BIRB_LIBRARY_VERSION = '0.1.0'
+
BIRB_SOURCES = [
'birbactionmenu.c',
'birbqueuedoutputstream.c',
@@ -11,7 +13,7 @@
]
BIRB_BUILT_HEADERS = []
-BIRB_GENERATED_SOURCES = []
+BIRB_BUILT_SOURCES = []
###############################################################################
# birbversionconsts.h
@@ -25,10 +27,28 @@
BIRB_BUILT_HEADERS += birb_version_consts_h
###############################################################################
+# Enums
+###############################################################################
+BIRB_ENUM_HEADERS = [
+ 'birbqueuedoutputstream.h',
+]
+
+birb_enums = gnome.mkenums_simple(
+ 'birbenums',
+ decorator : '_BIRB_EXTERN',
+ header_prefix : '#include "birbversion.h"',
+ sources : BIRB_ENUM_HEADERS,
+ install_header : true,
+ install_dir : get_option('includedir') / 'birb-1.0' / 'birb')
+
+BIRB_BUILT_SOURCES += birb_enums[0]
+BIRB_BUILT_HEADERS += birb_enums[1]
+
+###############################################################################
# Single Header
###############################################################################
BIRB_H_INCLUDES = []
-foreach header : BIRB_HEADERS
+foreach header : BIRB_HEADERS + ['birbversionconsts.h', 'birbenums.h']
BIRB_H_INCLUDES += f'#include <birb/@header@>'
endforeach
@@ -44,32 +64,17 @@
BIRB_BUILT_HEADERS += birb_h
###############################################################################
-# Enums
-###############################################################################
-BIRB_ENUM_HEADERS = [
- 'birbqueuedoutputstream.h',
-]
-
-birb_enums = gnome.mkenums_simple(
- 'birbenums',
- sources : BIRB_ENUM_HEADERS,
- install_header : true,
- install_dir : get_option('includedir') / 'birb-1.0' / 'birb')
-
-BIRB_GENERATED_SOURCES += birb_enums[0]
-BIRB_BUILT_HEADERS += birb_enums[1]
-
-###############################################################################
# Library Target
###############################################################################
birb_inc = include_directories('.')
birb_lib = library('birb',
- BIRB_SOURCES + BIRB_HEADERS + BIRB_GENERATED_SOURCES + BIRB_BUILT_HEADERS,
- c_args : ['-DBIRB_COMPILATION', '-DG_LOG_USE_STRUCTURED', '-DG_LOG_DOMAIN="Xeme"'],
+ BIRB_SOURCES + BIRB_HEADERS + BIRB_BUILT_SOURCES + BIRB_BUILT_HEADERS,
+ c_args : ['-DBIRB_COMPILATION', '-DG_LOG_USE_STRUCTURED', '-DG_LOG_DOMAIN="Birb"'],
gnu_symbol_visibility : 'hidden',
dependencies : [gio_dep, glib_dep, gobject_dep],
include_directories : [toplevel_inc, birb_inc],
+ version : BIRB_LIBRARY_VERSION,
install : true)
install_headers(
@@ -89,7 +94,8 @@
###############################################################################
if get_option('introspection')
birb_gir = gnome.generate_gir(birb_lib,
- sources : BIRB_SOURCES + BIRB_HEADERS,
+ sources : BIRB_SOURCES + BIRB_HEADERS +
+ BIRB_BUILT_SOURCES + BIRB_BUILT_HEADERS,
includes : ['Gio-2.0', 'GObject-2.0'],
header : 'birb.h',
namespace : 'Birb',
@@ -98,7 +104,6 @@
install : true,
export_packages : ['birb'],
extra_args : ['--quiet', '-DBIRB_COMPILATION'])
- BIRB_GENERATED_SOURCES += birb_gir
endif
###############################################################################
@@ -108,7 +113,7 @@
dependencies : [gio_dep, glib_dep, gobject_dep],
include_directories : [toplevel_inc, birb_inc],
link_with : birb_lib,
- sources : BIRB_BUILT_HEADERS)
+ sources : BIRB_BUILT_HEADERS + birb_gir)
meson.override_dependency('birb', birb_dep)