This commit is contained in:
2024-12-22 22:40:01 +02:00
parent db35aa7722
commit a9c4b5c7ab
7 changed files with 253 additions and 205 deletions

View File

@@ -1,12 +1,20 @@
const std = @import("std");
const headers = &[_][]const u8{
"common.h",
"ast.h",
"parser.h",
};
const c_lib_files = &[_][]const u8{
"tokenizer.c",
"ast.c",
"zig1.c",
"parser.c",
};
const all_c_files = c_lib_files ++ &[_][]const u8{"main.c"};
const cflags = &[_][]const u8{
"-std=c11",
"-Wall",
@@ -73,7 +81,7 @@ pub fn build(b: *std.Build) !void {
const lint_step = b.step("lint", "Run linters");
const clang_format = b.addSystemCommand(&.{"clang-format"});
clang_format.addArgs(&.{ "--style=webkit", "-i" });
for (all_c_files) |cfile| clang_format.addFileArg(b.path(cfile));
for (all_c_files ++ headers) |f| clang_format.addFileArg(b.path(f));
lint_step.dependOn(&clang_format.step);
const clang_analyze = b.addSystemCommand(&.{"clang"});