zig-cairo icon indicating copy to clipboard operation
zig-cairo copied to clipboard

Compiler flags (e.g. for XCB support)

Open jackdbd opened this issue 3 years ago • 0 comments

It should be possible to compile zig-cairo with or without support for optional Cairo surfaces. For example, in order to use XCB Surfaces, one has to link the XCB library. But since one might not be interested in using XCB surfaces, this feature should be optional.

Pycairo uses some compiler flags that define a few cairo.HAS constants to control whether these optional features are available or not. For example, this python script throws a runtime exception if Cairo was not compiled with PDF support.

In zig, maybe we could use @cDefine like it's done here?

See also:

  • https://bugzilla.redhat.com/show_bug.cgi?id=465759
  • https://ziglang.org/documentation/master/#Import-from-C-Header-File

jackdbd avatar Jan 20 '21 19:01 jackdbd