Skip to content

Instantly share code, notes, and snippets.

@donpdonp
Created May 30, 2019 18:56
Show Gist options
  • Save donpdonp/29c577985063acb48e69df74e433973f to your computer and use it in GitHub Desktop.
Save donpdonp/29c577985063acb48e69df74e433973f to your computer and use it in GitHub Desktop.
donp@jewel zig $ git diff
diff --git a/build.zig b/build.zig
index dd8c6fe..3411e9d 100644
--- a/build.zig
+++ b/build.zig
@@ -1,3 +1,4 @@
+const builtin = @import("builtin");
const Builder = @import("std").build.Builder;
pub fn build(b: *Builder) void {
@@ -44,6 +45,9 @@ pub fn build(b: *Builder) void {
exe.linkSystemLibrary("lmdb");
exe.setOutputDir(".");
+ exe.setTarget(builtin.Arch.x86_64,
+ builtin.Os.linux, //buildin.Os.macosx,
+ builtin.Abi.gnu);
b.default_step.dependOn(&exe.step);
//b.verbose_link = true;
//b.installExecutable(exe);
donp@jewel zig $ make
zig build
/home/donp/code/tootdeck/zig/src/db.zig:6:11: error: C import failed
const c = @cImport({
^
/home/donp/code/tootdeck/zig/zig-cache/o/LA-03YQttM5VOJhsUBq5i61sRciiRL7vX_4JZfMnjH8qLsIYSHtteOpiM3w-EJie/cimport.h:1:10: note: 'lmdb.h' file not found
#include <lmdb.h>
^
/home/donp/code/tootdeck/zig/src/net.zig:11:11: error: C import failed
const c = @cImport({
^
/home/donp/code/tootdeck/zig/zig-cache/o/OvdBcrjWv4awNiEh0AGUsOJcHtHWP3n29W6ky0-YfZi-S3q3oOmPF02SD4SD9seW/cimport.h:3:10: note: 'curl/curl.h' file not found
#include <curl/curl.h>
^
The following command exited with error code 1:
/opt/zig/2019-05-20/bin/zig build-exe /home/donp/code/tootdeck/zig/src/main.zig --library c --library gdk-3 --library gtk-3 --library gobject-2.0 --library gmodule-2.0 --library dl --library X11 --library pthread --library glfw3 --library curl --library nng --library lmdb --cache-dir /home/donp/code/tootdeck/zig/zig-cache --name zootdeck -target x86_64-linux-gnu -isystem /usr/include/gtk-3.0 -isystem /usr/include/glib-2.0 -isystem /usr/include/atk-1.0 -isystem /usr/include/pango-1.0 -isystem /usr/include/gdk-pixbuf-2.0 -isystem /usr/include/cairo -isystem /usr/lib/x86_64-linux-gnu/glib-2.0/include -isystem /home/donp/code/tootdeck/glfw/include -isystem /home/donp/code/tootdeck/glfw/deps -isystem /home/donp/code/tootdeck/nng/include --library-path ../glfw/build/src --library-path ../nng/build --output-dir .
Build failed. The following command failed:
/home/donp/code/tootdeck/zig/zig-cache/o/SsKK4B2kNfyrkJWKeZdju8o-6XhfdH3q7wObkZRizUEB-rtS6LL1OwpTDC36KLOu/build /opt/zig/2019-05-20/bin/zig /home/donp/code/tootdeck/zig /home/donp/code/tootdeck/zig/zig-cache
Makefile:3: recipe for target 'build' failed
make: *** [build] Error 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment