macros
This commit is contained in:
10
build.zig
10
build.zig
@@ -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"});
|
||||
|
||||
Reference in New Issue
Block a user