diff --git a/gio/meson.build b/gio/meson.build index 33b46324e..4cec90914 100644 --- a/gio/meson.build +++ b/gio/meson.build @@ -743,12 +743,15 @@ gio_headers = files( 'gliststore.h', ) -gvisibility_h = configure_file( +gvisibility_h = custom_target( output: 'gio-visibility.h', command: [gen_visibility_macros, meson.project_version(), 'visibility-macros', 'GIO', '@OUTPUT@'], + install: true, + install_dir: glib_includedir / 'gio', + install_tag : 'devel', ) +gio_sources += gvisibility_h -gio_headers += gvisibility_h gio_headers += application_headers gio_headers += settings_headers gio_headers += gdbus_headers @@ -857,6 +860,7 @@ schemas_subdir = join_paths('glib-2.0', 'schemas') libgio_dep = declare_dependency(link_with : libgio, dependencies : [libgmodule_dep, libgobject_dep, gioenumtypes_dep], + sources: gvisibility_h, include_directories : [gioinc], variables : [ 'schemasdir=' + join_paths(glib_datadir, schemas_subdir), diff --git a/glib/meson.build b/glib/meson.build index 56adf8758..b9e8680e0 100644 --- a/glib/meson.build +++ b/glib/meson.build @@ -1,19 +1,30 @@ +glib_sources = [] + glibconfig_h = configure_file(input : 'glibconfig.h.in', output : 'glibconfig.h', install_dir : join_paths(get_option('libdir'), 'glib-2.0/include'), install_tag : 'devel', configuration : glibconfig_conf) -gversionmacros_h = configure_file( +gversionmacros_h = custom_target( input: 'gversionmacros.h.in', output: 'gversionmacros.h', command: [gen_visibility_macros, meson.project_version(), 'versions-macros', '@INPUT@', '@OUTPUT@'], + install: true, + install_dir: glib_includedir, + install_tag : 'devel', ) -gvisibility_h = configure_file( +gvisibility_h = custom_target( output: 'glib-visibility.h', command: [gen_visibility_macros, meson.project_version(), 'visibility-macros', 'GLIB', '@OUTPUT@'], + install: true, + install_dir: glib_includedir / 'glib', + install_tag : 'devel', ) +glib_built_headers = [gversionmacros_h, gvisibility_h] +glib_sources += glib_built_headers + glib_c_args_internal = [ '-DGLIB_COMPILATION', ] @@ -231,8 +242,6 @@ glib_sub_headers = files( 'gprintf.h', ) -glib_sub_headers += [gversionmacros_h, gvisibility_h] - install_headers(glib_sub_headers, subdir : 'glib-2.0/glib') deprecated_sources = files( @@ -243,7 +252,7 @@ deprecated_sources = files( 'deprecated/gthread-deprecated.c' ) -glib_sources = files( +glib_sources += files( 'garcbox.c', 'garray.c', 'gasyncqueue.c', @@ -416,6 +425,7 @@ libglib = library('glib-2.0', libglib_dep = declare_dependency( link_with : libglib, dependencies : libintl_deps, + sources : glib_built_headers, # We sadly need to export configinc here because everyone includes include_directories : [configinc, glibinc]) diff --git a/gmodule/meson.build b/gmodule/meson.build index 54b25a0c5..0c5d7f89a 100644 --- a/gmodule/meson.build +++ b/gmodule/meson.build @@ -66,13 +66,15 @@ gmodule_c = files('gmodule.c') install_headers([gmodule_h], subdir : 'glib-2.0') -gvisibility_h = configure_file( +gvisibility_h = custom_target( output: 'gmodule-visibility.h', command: [gen_visibility_macros, meson.project_version(), 'visibility-macros', 'GMODULE', '@OUTPUT@'], + install: true, + install_dir: glib_includedir / 'gmodule', + install_tag : 'devel', ) -install_headers(gvisibility_h, subdir : 'glib-2.0/gmodule') -gmodule_sources = [gmodule_c] +gmodule_sources = [gmodule_c, gvisibility_h] if host_system == 'windows' gmodule_win_rc = configure_file( input: 'gmodule.rc.in', @@ -131,6 +133,7 @@ pkg.generate(libraries : [libgmodule, export_dynamic_ldflags], libgmodule_dep = declare_dependency(link_with : libgmodule, include_directories : [gmoduleinc], + sources : [gvisibility_h], dependencies : [libglib_dep]) meson.override_dependency('gmodule-no-export-2.0', libgmodule_dep) diff --git a/gobject/meson.build b/gobject/meson.build index 09c07f306..2c1981612 100644 --- a/gobject/meson.build +++ b/gobject/meson.build @@ -23,16 +23,20 @@ gobject_install_headers = files( 'gobjectnotifyqueue.c', # sic ) -gvisibility_h = configure_file( +gobject_sources = [] + +gvisibility_h = custom_target( output: 'gobject-visibility.h', command: [gen_visibility_macros, meson.project_version(), 'visibility-macros', 'GOBJECT', '@OUTPUT@'], + install: true, + install_dir: glib_includedir / 'gobject', + install_tag : 'devel', ) - -gobject_install_headers += gvisibility_h +gobject_sources += gvisibility_h install_headers(gobject_install_headers, subdir : 'glib-2.0/gobject') -gobject_sources = files( +gobject_sources += files( 'gatomicarray.c', 'gbinding.c', 'gbindinggroup.c', @@ -128,8 +132,6 @@ glib_enumtypes_c = custom_target('glib_enumtypes_c', '--template', files('glib-enumtypes.c.template'), '@INPUT@']) -glib_enumtypes_dep = declare_dependency(sources : [glib_enumtypes_h]) - # Expose as variable to be used by gobject-introspection # when it includes GLib as a subproject glib_types_h = files('glib-types.h') @@ -159,7 +161,9 @@ pkg.generate(libgobject, libgobject_dep = declare_dependency(link_with : libgobject, include_directories : [gobjectinc], - dependencies : [libglib_dep, glib_enumtypes_dep]) + sources : [gvisibility_h, glib_enumtypes_h], + dependencies : [libglib_dep], +) meson.override_dependency('gobject-2.0', libgobject_dep) executable('gobject-query', 'gobject-query.c',