Code translation was working just fine in 0.15.2 using the b.addTranslateC step. After upgrading to 0.16, I’m now getting wall of issues from glib:
error: translation failure
/usr/include/glib-2.0//glib/gutils.h:327:1: error: unknown type name 'pragma'
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
^
/usr/include/glib-2.0//glib/gmacros.h:757:39: note: expanded from here
_Pragma ("GCC diagnostic push")
^
<scratch space>:74:2: note: expanded from here
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
^
/usr/include/glib-2.0//glib/gutils.h:327:1: error: expected ';', found 'an identifier'
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
^
/usr/include/glib-2.0//glib/gmacros.h:757:39: note: expanded from here
_Pragma ("GCC diagnostic push")
^
<scratch space>:74:13: note: expanded from here
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
ad nauseum
I didn’t change anything with the translate C step
Build.zig
const deps = b.addTranslateC(.{
.root_source_file = b.path("c-deps.h"),
.target = target,
.optimize = optimize,
});
deps.addSystemIncludePath(.{ .cwd_relative = "/usr/include/gdk-pixbuf-2.0/" });
deps.addSystemIncludePath(.{ .cwd_relative = "/usr/include/glib-2.0/" });
deps.addSystemIncludePath(.{ .cwd_relative = "/usr/lib64/glib-2.0/include/" });
deps.addSystemIncludePath(.{ .cwd_relative = "/usr/include/cairo/" });
header file:
#include <cairo.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
What am I missing?