freedesktop.cairo
importcairo 1.18.2 — 2D vector drawing, backends as features with X11 off by default
import freedesktop.cairo;
#include <cairo.h>
模块名读自上游 src/cairo.cppm 里的 `export module` 声明。
mcpp add freedesktop.cairo@1.18.2
用法
来自本仓库自己的测试项目 —— CI 真的编译并运行过,不是为了网站写的。
// cairo, via its MODULE — and this is the route that had never been checked.
//
// ⭐ WHY THIS FILE EXISTS
//
// The package exposed `import freedesktop.cairo;` and the only test that named
// it also wrote `#include <cairo.h>`. So the header supplied whatever the
// module lacked, and what it lacked was substantial:
//
// 470 names exported, and among the missing:
// cairo_t the single most-used type in the library
// 192 enumerators every CAIRO_FORMAT_*, CAIRO_STATUS_*, CAIRO_OPERATOR_*
//
// It was found from OUTSIDE, by gnome.pangocairo — which cannot mix the two
// routes (pangocairo.h reaches glib and therefore <stdio.h>, so a textual
// include alongside the import makes `struct _IO_FILE` two entities) and
// therefore had to ask the module for `cairo_t` and got nothing.
//
// This file includes NOTHING. That is the whole point: if a name is missing
// from the module, this fails to compile.
#ifdef __linux__
// …
tests/examples/cairo/tests/module.cpp · 项目 tests/examples/cairo
构建 · 上游清单
- modules
freedesktop.cairo- targets
cairo (lib)- language
c++23- manifest version
1.18.2- dependencies
compat- 来源
https://raw.githubusercontent.com/mcpplibs/cairo/v1.18.2/mcpp/cairo/mcpp.toml