diff options
| author | t <t@tjp.lol> | 2026-06-15 22:11:53 -0600 |
|---|---|---|
| committer | t <t@tjp.lol> | 2026-06-16 11:17:14 -0600 |
| commit | f8c6d45755acb5abf9ac68931268b7945da0fae0 (patch) | |
| tree | a88ed7edd4aa3e5acced9ff99ac61b7f36b267a6 /build.zig | |
| parent | 8206642d3a1736aaf928a5b9a732e747f5294228 (diff) | |
display fixes: markdown rendering, tool-specific components
Diffstat (limited to 'build.zig')
| -rw-r--r-- | build.zig | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -34,6 +34,10 @@ pub fn build(b: *std.Build) void { .@"thread-pool" = false, }); + // Markdown parser for TUI rendering. MD4C is a small, permissively + // licensed C CommonMark parser; Zig owns only terminal rendering. + const md4c_dep = b.dependency("md4c", .{}); + // Fetch upstream Lua source (used both for our static library and // staged at runtime as the `include/` headers under $PANTO_HOME). // Reproducibility comes from the content-addressed hash in @@ -102,6 +106,7 @@ pub fn build(b: *std.Build) void { // table for `dlopen`'d rocks to resolve. addLuaSources(exe_mod, lua_src, lua_anchor_path); exe_mod.addIncludePath(lua_src.path("src")); + addMd4c(exe_mod, md4c_dep); // Compile lua.c (the upstream standalone interpreter, ~600 lines) // as a separate static library so we can route the `panto lua` @@ -156,6 +161,7 @@ pub fn build(b: *std.Build) void { })); addLuaSources(test_mod, lua_src, lua_anchor_path); test_mod.addIncludePath(lua_src.path("src")); + addMd4c(test_mod, md4c_dep); test_mod.linkLibrary(lua_repl); const unit_tests = b.addTest(.{ @@ -172,6 +178,20 @@ pub fn build(b: *std.Build) void { test_step.dependOn(&lib_test_step.step); } +fn addMd4c(mod: *std.Build.Module, md4c_dep: *std.Build.Dependency) void { + const cflags = [_][]const u8{ + "-std=c99", + "-Wall", + "-Wextra", + "-Wno-unused-parameter", + }; + mod.addCSourceFile(.{ + .file = md4c_dep.path("src/md4c.c"), + .flags = &cflags, + }); + mod.addIncludePath(md4c_dep.path("src")); +} + /// Compile a thin wrapper around the upstream `lua.c` standalone /// interpreter that exposes `pmain` for panto's `lua` subcommand to /// invoke against a pre-configured `lua_State`. |
