gplugin/gplugin

Parents e45995169907
Children d01d2ae04291
Add gir targets to the dependencies sources attribute and other meson cleanups.

Adding the gir targs to the dependency object of the library allows us to be
able to use the dependency in a gnome.generate_gir for a library that consumes
our api regardless of if it's a system install or a subproject.

Testing Done:
Modified the gplugin subproject in pidgin and used these changes to verify that it fixed the current build issues over there.

Reviewed at https://reviews.imfreedom.org/r/939/
--- a/gplugin-gtk/meson.build Fri Sep 24 02:49:03 2021 -0500
+++ b/gplugin-gtk/meson.build Sat Sep 25 03:22:16 2021 -0500
@@ -31,6 +31,9 @@
GPLUGIN_GTK_PUBLIC_BUILT_HEADERS = [
]
+GPLUGIN_GTK_GENERATED_TARGETS = [
+]
+
###############################################################################
# Configure Files
###############################################################################
@@ -87,28 +90,17 @@
gplugin_gtk_inc = include_directories('.')
-gplugin_gtk_dep = declare_dependency(
- include_directories: [toplevel_inc, gplugin_gtk_inc],
- link_with : [gplugin, gplugin_gtk],
- sources : GPLUGIN_GTK_PUBLIC_BUILT_HEADERS, # Ensure they're built before use.
- dependencies : [GLIB, GOBJECT, GTK3],
-)
-
-if meson.version().version_compare('>=0.54.0')
- meson.override_dependency('gplugin-gtk', gplugin_gtk_dep)
-endif
-
pkgconfig.generate(
- gplugin_gtk,
- name : 'gplugin-gtk',
- description : 'Gtk widgets for GPlugin',
- filebase : 'gplugin-gtk',
- subdirs : 'gplugin-1.0',
- libraries : [gplugin],
- requires : [GLIB, GOBJECT, GMODULE],
- variables : [
- 'plugindir=${libdir}',
- ],
+ gplugin_gtk,
+ name : 'gplugin-gtk',
+ description : 'Gtk widgets for GPlugin',
+ filebase : 'gplugin-gtk',
+ subdirs : 'gplugin-1.0',
+ libraries : [gplugin],
+ requires : [GLIB, GOBJECT, GMODULE],
+ variables : [
+ 'plugindir=${libdir}',
+ ],
)
###############################################################################
@@ -126,7 +118,23 @@
nsversion : '1.0',
install : true,
export_packages: ['gplugin-gtk'],
+ dependencies : [gplugin_dep],
extra_args : ['--quiet', '-DGPLUGIN_GTK_COMPILATION'])
+ GPLUGIN_GTK_GENERATED_TARGETS += gplugin_gtk_gir
+endif
+
+###############################################################################
+# Library Dependency Object
+###############################################################################
+gplugin_gtk_dep = declare_dependency(
+ include_directories: [toplevel_inc, gplugin_gtk_inc],
+ link_with : [gplugin, gplugin_gtk],
+ sources : GPLUGIN_GTK_PUBLIC_BUILT_HEADERS + GPLUGIN_GTK_GENERATED_TARGETS,
+ dependencies : [GLIB, GOBJECT, GTK3],
+)
+
+if meson.version().version_compare('>=0.54.0')
+ meson.override_dependency('gplugin-gtk', gplugin_gtk_dep)
endif
###############################################################################
@@ -141,8 +149,6 @@
###############################################################################
# subdirectories
###############################################################################
-if get_option('doc')
- subdir('reference')
-endif
+subdir('reference')
endif # gtk3
--- a/gplugin/meson.build Fri Sep 24 02:49:03 2021 -0500
+++ b/gplugin/meson.build Sat Sep 25 03:22:16 2021 -0500
@@ -58,6 +58,10 @@
'gplugin-native-loader.c',
]
+GPLUGIN_GENERATED_TARGETS = [
+ # Modified below.
+]
+
###############################################################################
# gplugin-enum.[ch] generation
###############################################################################
@@ -162,17 +166,6 @@
install : true
)
-gplugin_dep = declare_dependency(
- include_directories : [toplevel_inc, include_directories('.')],
- link_with : gplugin,
- sources : GPLUGIN_PUBLIC_BUILT_HEADERS, # Ensure they're built before use.
- dependencies : [GLIB, GOBJECT]
-)
-
-if meson.version().version_compare('>=0.54.0')
- meson.override_dependency('gplugin', gplugin_dep)
-endif
-
pkgconfig.generate(
gplugin,
name : 'gplugin',
@@ -186,16 +179,6 @@
)
###############################################################################
-# loader-tests static library
-###############################################################################
-gplugin_loader_tests = static_library('gplugin-loader-tests',
- 'gplugin-loader-tests.c',
- 'gplugin-loader-tests.h',
- c_args : ['-DGI_TYPELIB_PATH="@0@"'.format(meson.current_build_dir())],
- dependencies : [gplugin_dep],
-)
-
-###############################################################################
# GObject Introspection
###############################################################################
if get_option('introspection')
@@ -211,9 +194,34 @@
install : true,
export_packages : ['gplugin'],
extra_args : ['--quiet', '-DGPLUGIN_COMPILATION'])
+ GPLUGIN_GENERATED_TARGETS += gplugin_gir
endif
###############################################################################
+# Library Dependency Object
+###############################################################################
+gplugin_dep = declare_dependency(
+ include_directories : [toplevel_inc, include_directories('.')],
+ link_with : gplugin,
+ sources : GPLUGIN_PUBLIC_BUILT_HEADERS + GPLUGIN_GENERATED_TARGETS,
+ dependencies : [GLIB, GOBJECT]
+)
+
+if meson.version().version_compare('>=0.54.0')
+ meson.override_dependency('gplugin', gplugin_dep)
+endif
+
+###############################################################################
+# loader-tests static library
+###############################################################################
+gplugin_loader_tests = static_library('gplugin-loader-tests',
+ 'gplugin-loader-tests.c',
+ 'gplugin-loader-tests.h',
+ c_args : ['-DGI_TYPELIB_PATH="@0@"'.format(meson.current_build_dir())],
+ dependencies : [gplugin_dep],
+)
+
+###############################################################################
# Install Stuff
###############################################################################
# install the normal includes into the gplugin subdirectory
@@ -226,9 +234,6 @@
###############################################################################
# subdirectories
###############################################################################
+subdir('reference')
subdir('share')
subdir('tests')
-
-if get_option('doc')
- subdir('reference')
-endif