Fix build when cairo is a subproject
Try this:
meson --wrap-mode=forcefallback --prefix=~/some-new-directory build-dir
There are two problems when cairo is a subproject, and it's not installed when gtk is built. First you get
../gdk/x11/gdkglcontext-x11.c:40:10: fatal error: cairo/cairo-xlib.h: No such file or directory
40 | #include <cairo/cairo-xlib.h>
| ^~~~~~~~~~~~~~~~~~~~
because cairo-xlib.h is not stored in cairo/ in the source directory. Then, when that has been fixed
/usr/bin/ld: warning: libcairo-script-interpreter.so.2, needed by gtk/libgtk-4.so.1.102.0, not found (try using -rpath or -rpath-link)
/usr/bin/ld: gtk/libgtk-4.so.1.102.0: undefined reference to `cairo_script_interpreter_create'
/usr/bin/ld: gtk/libgtk-4.so.1.102.0: undefined reference to `cairo_script_interpreter_feed_string'
/usr/bin/ld: gtk/libgtk-4.so.1.102.0: undefined reference to `cairo_script_interpreter_destroy'
/usr/bin/ld: gtk/libgtk-4.so.1.102.0: undefined reference to `cairo_script_interpreter_install_hooks'
collect2: error: ld returned 1 exit status
because libcairo-script-interpreter is not stored in the same directory as other cairo libraries.