Because of the accumulators mechanism behind CAIRO_ENABLE_FUNCTIONS, enabling gobject library causes its dependencies to leak to main cairo.pc file (i.e. Requires.private contains glib-2.0 and gobject-2.0 libraries).
This leakage could be avoided using e.g. such patch:
but it's rather a hack; nicer solution would be not to use CAIRO_ENABLE_FUNCTIONS for separate library or to introduce e.g. CAIRO_ENABLE_LIBRARY which works similar to CAIRO_ENABLE_FUNCTIONS, but doesn't accumulate gobject_* values to CAIRO_*.
But if you compile with gobject, then gobject is needed as a private dependency. This is working-as-intended.
libgobject is needed for libcairo-gobject, but I don't see any use of libgobject in libcairo.
Accumulators cause that -lgobject-2.0 is passed for libcairo linking (through CAIRO_LIBS), but libcairo doesn't use any symbols from libgobject and when as-needed linker feature is used, this dependency is dropped.
When packaging cairo, cairo-gobject library can go to separate package set; in such case glib/gobject dependency in packages with main cairo library could be avoided.
Ok I see what you mean.
When I designed the acummulators originally, there was only libcairo... And things where designed around having one library only.
-- GitLab Migration Automatic Message --
This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.
You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/cairo/cairo/issues/10.