meson: make sure gsk/gdk generated headers exist for libgtk_dep users

Add back dependencies on libgdk_dep and libsk_dep which are declared
dependencies. We removed this before because these declarations had
link_with: lines that dragged in the static libgdk.a and libgsk.a libs
which are linked into libgtk-4.so anyway and thus shouldn't be used
when linking internal exes/tools against libgtk-4. Remove the static
libs from the declared dependencies and have libgtk link those in
explicitly, so that the declared deps now just provide all the built
dependencies and include dirs and such for declared libgtk_dep users
such as the internal exes/tools, which want all the generated gsk/gdk/gtk
headers to exist before attempting to compile anything against the
gtk+ headers.
This commit is contained in:
Tim-Philipp Müller 2017-03-22 00:45:39 +00:00 committed by Emmanuele Bassi
parent 48e2b77369
commit f67a9d58db
4 changed files with 21 additions and 26 deletions

View File

@ -199,15 +199,13 @@ libgdk = static_library('gdk',
c_args: ['-DGDK_COMPILATION', '-DG_LOG_DOMAIN="Gdk"'],
include_directories: [confinc, xinc, wlinc],
link_with: gdk_backends,
dependencies: gdk_deps,
)
dependencies: gdk_deps)
# We don't have link_with: to internal static libs here on purpose, just
# list the dependencies and generated headers and such, for use in the
# "public" libgtk_dep used by internal executables.
libgdk_dep = declare_dependency(
sources: ['gdk.h', gdkconfig, gdkenum_h],
depends: gdk_sources,
include_directories: [confinc, xinc, wlinc],
dependencies: gdk_deps,
link_with: libgdk,
link_args: ['-Bsymbolic'],
)
dependencies: gdk_deps)

View File

@ -157,12 +157,14 @@ libgsk = static_library('gsk',
dependencies: gsk_deps,
include_directories: [confinc],
c_args: ['-DGSK_COMPILATION', '-DG_LOG_DOMAIN="Gsk"'],
)
link_with: libgdk,
link_args: ['-Bsymbolic'])
# We don't have link_with: to internal static libs here on purpose, just
# list the dependencies and generated headers and such, for use in the
# "public" libgtk_dep used by internal executables.
libgsk_dep = declare_dependency(
depends: gsk_sources,
link_with: libgsk,
link_args: ['-Bsymbolic'],
include_directories: [confinc],
sources: [gskenum_h, gskresources]
)
sources: [gskenum_h, gskresources],
dependencies: libgdk_dep)

View File

@ -830,22 +830,17 @@ libgtk = shared_library('gtk-4',
sources: [typefuncs, gtk_sources, gtkmarshal_h, gtkprivatetypebuiltins_h],
c_args: gtk_cargs,
include_directories: [confinc, gdkinc, gtkinc],
dependencies: [gtk_deps, libgdk_dep, libgsk_dep],
install: true
)
dependencies: gtk_deps + [libgdk_dep, libgsk_dep],
link_with: [libgdk, libgsk],
link_args: ['-Bsymbolic'],
install: true)
libgtk_dep = declare_dependency(
sources: [
'gtk.h',
gtkversion,
gtktypebuiltins_h,
],
include_directories: [confinc],
dependencies: gtk_deps,
sources: [gtkversion, gtktypebuiltins_h],
include_directories: [confinc, gtkinc],
dependencies: gtk_deps + [libgdk_dep, libgsk_dep],
link_with: libgtk,
link_args: ['-Bsymbolic'],
include_directories: [confinc, gtkinc]
)
link_args: ['-Bsymbolic'])
# Installed tools

View File

@ -17,7 +17,7 @@ test('gdk/keysyms', test_keysyms)
test_rectangle = executable('rectangle', 'rectangle.c', dependencies: libgtk_dep)
test('gdk/rectangle', test_rectangle)
test_rgba = executable('rgba', 'rgba.c', dependencies: libgdk_dep)
test_rgba = executable('rgba', 'rgba.c', dependencies: libgtk_dep)
test('gdk/rgba', test_rgba)
test_seat = executable('seat', 'seat.c', dependencies: libgtk_dep)