Skip to content

Conversation

wezm
Copy link
Contributor

@wezm wezm commented Jun 27, 2025

In Prince we use a custom build of Cairo that is built with a shared configuration across platforms. This configuration does not enable Quartz surfaces, since we don't use them. When trying to use this build of cairo from cairo-rs on macOS we get these linker errors:

Making Mercury/hlc.par.gc/aarch64-apple-darwin23.3.0/Mercury/bin/prince
Undefined symbols for architecture arm64:
  "_cairo_quartz_surface_create", referenced from:
      cairo::quartz_surface::QuartzSurface::create::hd523178627094f5c in libfontcode.a[26](cairo-985f17ee8c3b353d.cairo.82c62016cb75f98b-cgu.7.rcgu.o)
  "_cairo_quartz_surface_create_for_cg_context", referenced from:
      cairo::quartz_surface::QuartzSurface::create_for_cg_context::hfd933effa02b3a48 in libfontcode.a[26](cairo-985f17ee8c3b353d.cairo.82c62016cb75f98b-cgu.7.rcgu.o)
  "_cairo_quartz_surface_get_cg_context", referenced from:
      cairo::quartz_surface::QuartzSurface::cg_context::h0e678fb701e283dd in libfontcode.a[26](cairo-985f17ee8c3b353d.cairo.82c62016cb75f98b-cgu.7.rcgu.o)
ld: symbol(s) not found for architecture arm64

This PR introduces a quartz-surface cargo feature to make it possible to compile cairo-rs without Quartz surfaces.

As it stands this will be a breaking change from the status quo as Quartz surfaces will become opt-in. I'm aware that this may not be desired, but it does match the win32 behaviour. If this is not desired I can add it to the default features.

@sdroege
Copy link
Member

sdroege commented Jun 30, 2025

Rebased so that the CI can pass

@bilelmoussaoui bilelmoussaoui merged commit 229c7bc into gtk-rs:main Jun 30, 2025
48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants