From c8a424ff2e22cda61ff4bd7f90ad805c20af9d92 Mon Sep 17 00:00:00 2001 From: Locria Cyber <74560659+iacore@users.noreply.github.com> Date: Sat, 25 Nov 2023 14:09:16 +0000 Subject: [PATCH 1/2] Add build.zig --- .gitignore | 1 + build.zig | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 build.zig diff --git a/.gitignore b/.gitignore index bf65da380a..9643f24cbf 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ *.so *.so.* *.a +zig-cache/ diff --git a/build.zig b/build.zig new file mode 100644 index 0000000000..61187f7cf4 --- /dev/null +++ b/build.zig @@ -0,0 +1,19 @@ +const std = @import("std"); + +pub fn build(b: *std.Build) void { + const target = b.standardTargetOptions(.{}); + const optimize = b.standardOptimizeOption(.{}); + + const lib = b.addStaticLibrary(.{ + .name = "mir", + .target = target, + .optimize = optimize, + }); + lib.linkLibC(); + lib.addCSourceFiles(&.{ + "mir.c", + "mir-gen.c", + }, &.{}); + + b.installArtifact(lib); +} From afa617c463c956af8e730b7bcecc656fa5791617 Mon Sep 17 00:00:00 2001 From: Locria Cyber <74560659+iacore@users.noreply.github.com> Date: Sat, 25 Nov 2023 14:34:23 +0000 Subject: [PATCH 2/2] Do not sanitize C --- build.zig | 1 + 1 file changed, 1 insertion(+) diff --git a/build.zig b/build.zig index 61187f7cf4..beddf7809f 100644 --- a/build.zig +++ b/build.zig @@ -9,6 +9,7 @@ pub fn build(b: *std.Build) void { .target = target, .optimize = optimize, }); + lib.disable_sanitize_c = true; lib.linkLibC(); lib.addCSourceFiles(&.{ "mir.c",