commit 035fdb4568f59eb26bc4536cbf3d37468796d920 Author: Rokas Puzonas Date: Tue Oct 1 23:33:56 2024 +0300 initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4c82b07 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +zig-cache +zig-out diff --git a/build.zig b/build.zig new file mode 100644 index 0000000..a4cea27 --- /dev/null +++ b/build.zig @@ -0,0 +1,29 @@ +const std = @import("std"); + +pub fn build(b: *std.Build) void { + const target = b.standardTargetOptions(.{}); + const optimize = b.standardOptimizeOption(.{}); + + const exe = b.addExecutable(.{ + .name = "http.c", + .target = target, + .optimize = optimize, + }); + exe.addCSourceFile(.{ + .file = b.path("src/main.c"), + .flags = &.{} + }); + exe.linkLibC(); + + b.installArtifact(exe); + + const run_cmd = b.addRunArtifact(exe); + run_cmd.step.dependOn(b.getInstallStep()); + + if (b.args) |args| { + run_cmd.addArgs(args); + } + + const run_step = b.step("run", "Run the app"); + run_step.dependOn(&run_cmd.step); +} diff --git a/build.zig.zon b/build.zig.zon new file mode 100644 index 0000000..92ba78a --- /dev/null +++ b/build.zig.zon @@ -0,0 +1,7 @@ +.{ + .name = "http.c", + .version = "0.1.0", + .minimum_zig_version = "0.12.0", + .dependencies = .{ }, + .paths = .{ "" }, +} diff --git a/src/main.c b/src/main.c new file mode 100644 index 0000000..ef66efb --- /dev/null +++ b/src/main.c @@ -0,0 +1,6 @@ +#include + +int main() { + printf("Hello, World!\n"); + return 0; +}