forked from drawmeanelephant/boris
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.zig
More file actions
597 lines (543 loc) · 22.2 KB
/
Copy pathbuild.zig
File metadata and controls
597 lines (543 loc) · 22.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
const std = @import("std");
/// Boris build graph.
/// Product CLI: typed options + IR pipeline (m6) + RAG export (m7) +
/// scanner/parser (m4–m5). Milestone 8: in-process Apex C ABI (linked; not
/// default IR/RAG path). Milestone 9: experimental HTML assemble/compile tests
/// (not default CLI). Milestone 10: Aside tokenizer + hardening. Fixture
/// inventory (m2). Separate tools: `boris-source-rag`, `boris-package`.
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
// Feature 1: build static ApexMarkdown (cmake host tool only).
// Host ABI: vendor/apex; engine: vendor/apex-markdown (see VENDOR.md).
// Script always runs (side effects) but exits immediately when the D3 stamp
// and static archives are current — avoids full cmake on every zig build.
// D2: script forces no system libyaml (see scripts/build-apex-markdown.sh).
const ensure_apex = b.addSystemCommand(&.{
"bash",
"scripts/build-apex-markdown.sh",
});
ensure_apex.setCwd(b.path("."));
ensure_apex.has_side_effects = true;
const build_apex_step = b.step(
"build-apex",
"Build ApexMarkdown static libraries via CMake (host tool: cmake)",
);
build_apex_step.dependOn(&ensure_apex.step);
// build_options: hostile_apex swaps the C engine for ABI hostility tests.
const apex_opts = b.addOptions();
apex_opts.addOption(bool, "hostile_apex", false);
const hostile_opts = b.addOptions();
hostile_opts.addOption(bool, "hostile_apex", true);
// --- Product CLI (milestone 6 IR surface + m8 Apex link) --------------
const root_mod = b.createModule(.{
.root_source_file = b.path("src/main.zig"),
.target = target,
.optimize = optimize,
});
// Linked into the process for the C ABI surface; default CLI does not call Apex.
linkApex(root_mod, b, false);
root_mod.addOptions("build_options", apex_opts);
const exe = b.addExecutable(.{
.name = "boris",
.root_module = root_mod,
});
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 Boris");
run_step.dependOn(&run_cmd.step);
// Main + CLI + pipeline unit tests (cwd = package root for fixtures).
const unit_tests = b.addTest(.{
.root_module = root_mod,
});
const run_unit_tests = b.addRunArtifact(unit_tests);
run_unit_tests.setCwd(b.path("."));
// --- Fixture inventory tests (milestone 2) -----------------------------
const fixtures_mod = b.createModule(.{
.root_source_file = b.path("src/fixtures_test.zig"),
.target = target,
.optimize = optimize,
});
const fixtures_tests = b.addTest(.{
.root_module = fixtures_mod,
});
const run_fixtures_tests = b.addRunArtifact(fixtures_tests);
run_fixtures_tests.setCwd(b.path("."));
// --- Scanner + identity tests (milestone 4) ----------------------------
const scanner_mod = b.createModule(.{
.root_source_file = b.path("src/scanner.zig"),
.target = target,
.optimize = optimize,
});
const scanner_tests = b.addTest(.{
.root_module = scanner_mod,
});
const run_scanner_tests = b.addRunArtifact(scanner_tests);
run_scanner_tests.setCwd(b.path("."));
// --- Frontmatter parser tests (milestone 5) ----------------------------
const parser_mod = b.createModule(.{
.root_source_file = b.path("src/parser.zig"),
.target = target,
.optimize = optimize,
});
const parser_tests = b.addTest(.{
.root_module = parser_mod,
});
const run_parser_tests = b.addRunArtifact(parser_tests);
run_parser_tests.setCwd(b.path("."));
// --- Explicit bounded Textile-to-Markdown adapter ---------------------
const textile_mod = b.createModule(.{
.root_source_file = b.path("src/textile.zig"),
.target = target,
.optimize = optimize,
});
const textile_tests = b.addTest(.{
.root_module = textile_mod,
});
const run_textile_tests = b.addRunArtifact(textile_tests);
run_textile_tests.setCwd(b.path("."));
// --- Pipeline + graph tests (milestone 6) ------------------------------
// Pipeline imports aside (component validation) → needs Apex link.
const pipeline_mod = b.createModule(.{
.root_source_file = b.path("src/pipeline.zig"),
.target = target,
.optimize = optimize,
});
linkApex(pipeline_mod, b, false);
pipeline_mod.addOptions("build_options", apex_opts);
const pipeline_tests = b.addTest(.{
.root_module = pipeline_mod,
});
const run_pipeline_tests = b.addRunArtifact(pipeline_tests);
run_pipeline_tests.setCwd(b.path("."));
const graph_mod = b.createModule(.{
.root_source_file = b.path("src/graph.zig"),
.target = target,
.optimize = optimize,
});
const graph_tests = b.addTest(.{
.root_module = graph_mod,
});
const run_graph_tests = b.addRunArtifact(graph_tests);
run_graph_tests.setCwd(b.path("."));
// --- Aside component tokenizer + HTML render (milestone 10) ------------
const aside_mod = b.createModule(.{
.root_source_file = b.path("src/aside.zig"),
.target = target,
.optimize = optimize,
});
linkApex(aside_mod, b, false);
aside_mod.addOptions("build_options", apex_opts);
const aside_tests = b.addTest(.{
.root_module = aside_mod,
});
const run_aside_tests = b.addRunArtifact(aside_tests);
run_aside_tests.setCwd(b.path("."));
// --- RAG export tests (milestone 7 + m10 :::kind) ----------------------
const rag_mod = b.createModule(.{
.root_source_file = b.path("src/rag.zig"),
.target = target,
.optimize = optimize,
});
linkApex(rag_mod, b, false);
rag_mod.addOptions("build_options", apex_opts);
const rag_tests = b.addTest(.{
.root_module = rag_mod,
});
const run_rag_tests = b.addRunArtifact(rag_tests);
run_rag_tests.setCwd(b.path("."));
// --- Apex C ABI tests (milestone 8) ------------------------------------
// Direct @cImport binding tests against the real vendor engine.
const apex_mod = b.createModule(.{
.root_source_file = b.path("src/apex.zig"),
.target = target,
.optimize = optimize,
});
linkApex(apex_mod, b, false);
apex_mod.addOptions("build_options", apex_opts);
const apex_tests = b.addTest(.{
.root_module = apex_mod,
});
const run_apex_tests = b.addRunArtifact(apex_tests);
run_apex_tests.setCwd(b.path("."));
// --- Experimental HTML assemble + whiteboard compile (milestone 9) -----
// Not on the default IR/RAG CLI path; tests only.
const assemble_mod = b.createModule(.{
.root_source_file = b.path("src/assemble.zig"),
.target = target,
.optimize = optimize,
});
const assemble_tests = b.addTest(.{
.root_module = assemble_mod,
});
const run_assemble_tests = b.addRunArtifact(assemble_tests);
run_assemble_tests.setCwd(b.path("."));
const theme_mod = b.createModule(.{
.root_source_file = b.path("src/theme.zig"),
.target = target,
.optimize = optimize,
});
const theme_tests = b.addTest(.{
.root_module = theme_mod,
});
const run_theme_tests = b.addRunArtifact(theme_tests);
run_theme_tests.setCwd(b.path("."));
const content_asset_mod = b.createModule(.{
.root_source_file = b.path("src/content_asset.zig"),
.target = target,
.optimize = optimize,
});
const content_asset_tests = b.addTest(.{
.root_module = content_asset_mod,
});
const run_content_asset_tests = b.addRunArtifact(content_asset_tests);
run_content_asset_tests.setCwd(b.path("."));
const layout_select_mod = b.createModule(.{
.root_source_file = b.path("src/layout_select.zig"),
.target = target,
.optimize = optimize,
});
const layout_select_tests = b.addTest(.{
.root_module = layout_select_mod,
});
const run_layout_select_tests = b.addRunArtifact(layout_select_tests);
run_layout_select_tests.setCwd(b.path("."));
const compile_mod = b.createModule(.{
.root_source_file = b.path("src/compile.zig"),
.target = target,
.optimize = optimize,
});
linkApex(compile_mod, b, false);
compile_mod.addOptions("build_options", apex_opts);
const compile_tests = b.addTest(.{
.root_module = compile_mod,
});
const run_compile_tests = b.addRunArtifact(compile_tests);
run_compile_tests.setCwd(b.path("."));
// Opt-in 200-page incremental HTML smoke. Kept out of `zig build test`
// because it exercises a bounded large-site fixture rather than unit scope.
const scale_smoke_mod = b.createModule(.{
.root_source_file = b.path("src/incremental_scale_smoke_test.zig"),
.target = target,
.optimize = optimize,
});
linkApex(scale_smoke_mod, b, false);
scale_smoke_mod.addOptions("build_options", apex_opts);
const scale_smoke_tests = b.addTest(.{
.root_module = scale_smoke_mod,
});
const run_scale_smoke_tests = b.addRunArtifact(scale_smoke_tests);
run_scale_smoke_tests.setCwd(b.path("."));
const test_scale_smoke_step = b.step(
"test-scale-smoke",
"Run opt-in 200-page incremental HTML scale smoke",
);
test_scale_smoke_step.dependOn(&run_scale_smoke_tests.step);
// Hostile Apex double: Zig wrapper imports a named "apex" module that
// links apex_hostile.c (never the product binary).
const apex_hostile_lib_mod = b.createModule(.{
.root_source_file = b.path("src/apex.zig"),
.target = target,
.optimize = optimize,
});
linkApex(apex_hostile_lib_mod, b, true);
apex_hostile_lib_mod.addOptions("build_options", hostile_opts);
const apex_hostile_root = b.createModule(.{
.root_source_file = b.path("src/apex_hostile_test.zig"),
.target = target,
.optimize = optimize,
.imports = &.{
.{ .name = "apex", .module = apex_hostile_lib_mod },
},
});
const apex_hostile_tests = b.addTest(.{
.root_module = apex_hostile_root,
});
const run_apex_hostile_tests = b.addRunArtifact(apex_hostile_tests);
run_apex_hostile_tests.setCwd(b.path("."));
const test_apex_hostile_step = b.step(
"test-apex-hostile",
"Run Apex Zig wrapper tests against the hostile C ABI double",
);
test_apex_hostile_step.dependOn(&run_apex_hostile_tests.step);
// Optional ASan+UBSan C smoke (host adapter + real ApexMarkdown, not product binary).
// Hosts without sanitizer runtime get a documented skip (exit 0), not a fake pass.
const sanitize_step = b.step(
"test-apex-sanitize",
"Optional ASan+UBSan smoke for vendor/apex adapter (skips if unavailable)",
);
const sanitize_run = b.addSystemCommand(&.{
"bash",
"-c",
\\set -euo pipefail
\\OUT="${TMPDIR:-/tmp}/boris-apex-sanitize-smoke-$$"
\\LOG="${TMPDIR:-/tmp}/boris-apex-sanitize-build-$$.log"
\\cleanup() { rm -f "$OUT" "$LOG"; }
\\trap cleanup EXIT
\\bash scripts/build-apex-markdown.sh >/dev/null
\\if ! zig cc -std=c11 -fsanitize=address,undefined -fno-omit-frame-pointer -g \
\\ -I vendor/apex \
\\ -I vendor/apex-markdown/include \
\\ -I vendor/apex-markdown/vendor/cmark-gfm/src \
\\ -I vendor/apex-markdown/build/vendor/cmark-gfm/src \
\\ vendor/apex/apex.c vendor/apex/apex_sanitize_smoke.c \
\\ vendor/apex-markdown/build/libapex.a \
\\ vendor/apex-markdown/build/vendor/cmark-gfm/extensions/libcmark-gfm-extensions.a \
\\ vendor/apex-markdown/build/vendor/cmark-gfm/src/libcmark-gfm.a \
\\ -o "$OUT" >"$LOG" 2>&1; then
\\ echo "test-apex-sanitize: NOT AVAILABLE on this host (sanitizer build failed)"
\\ echo "--- zig cc log (first 40 lines) ---"
\\ head -40 "$LOG" || true
\\ if [ "${BORIS_REQUIRE_SANITIZE:-}" = "1" ]; then
\\ echo "BORIS_REQUIRE_SANITIZE=1: failing (not a documented skip)."
\\ exit 1
\\ fi
\\ echo "Documented skip — not counted as a green sanitizer run."
\\ exit 0
\\fi
\\echo "test-apex-sanitize: running ASan+UBSan smoke..."
\\"$OUT"
\\echo "test-apex-sanitize: ok"
});
sanitize_run.setCwd(b.path("."));
sanitize_step.dependOn(&sanitize_run.step);
// --- Standalone source RAG tool (not product pipeline) -----------------
const source_rag_mod = b.createModule(.{
.root_source_file = b.path("tools/source-rag/main.zig"),
.target = target,
.optimize = optimize,
});
const source_rag_exe = b.addExecutable(.{
.name = "boris-source-rag",
.root_module = source_rag_mod,
});
b.installArtifact(source_rag_exe);
const source_rag_run = b.addRunArtifact(source_rag_exe);
source_rag_run.setCwd(b.path("."));
if (b.args) |args| {
source_rag_run.addArgs(args);
}
const source_rag_step = b.step(
"source-rag",
"Generate source-code RAG corpus for LLM upload (boris-source-rag)",
);
source_rag_step.dependOn(&source_rag_run.step);
const source_rag_tests = b.addTest(.{
.root_module = source_rag_mod,
});
const run_source_rag_tests = b.addRunArtifact(source_rag_tests);
// --- Hardening integration tests (milestone 10) ------------------------
const hardening_mod = b.createModule(.{
.root_source_file = b.path("src/hardening_test.zig"),
.target = target,
.optimize = optimize,
});
linkApex(hardening_mod, b, false);
hardening_mod.addOptions("build_options", apex_opts);
const hardening_tests = b.addTest(.{
.root_module = hardening_mod,
});
const run_hardening_tests = b.addRunArtifact(hardening_tests);
run_hardening_tests.setCwd(b.path("."));
// Layout-selection hostile integration (PR #50 audit harness; no product patches).
const layout_hostile_mod = b.createModule(.{
.root_source_file = b.path("src/layout_select_hostile_test.zig"),
.target = target,
.optimize = optimize,
});
linkApex(layout_hostile_mod, b, false);
layout_hostile_mod.addOptions("build_options", apex_opts);
const layout_hostile_tests = b.addTest(.{
.root_module = layout_hostile_mod,
});
const run_layout_hostile_tests = b.addRunArtifact(layout_hostile_tests);
run_layout_hostile_tests.setCwd(b.path("."));
const test_layout_hostile_step = b.step(
"test-layout-hostile",
"Hostile integration coverage for --layout-rule selection",
);
test_layout_hostile_step.dependOn(&run_layout_hostile_tests.step);
// Fuzz suite (frontmatter / component / apex / graph) — deterministic seeds.
const fuzz_mod = b.createModule(.{
.root_source_file = b.path("src/fuzz.zig"),
.target = target,
.optimize = optimize,
});
linkApex(fuzz_mod, b, false);
fuzz_mod.addOptions("build_options", apex_opts);
const fuzz_tests = b.addTest(.{
.root_module = fuzz_mod,
});
const run_fuzz_tests = b.addRunArtifact(fuzz_tests);
run_fuzz_tests.setCwd(b.path("."));
// --- Review package (IR + optional RAG tar) ----------------------------
// Reuses pipeline.run / rag.run; does not change IR schema or HTML defaults.
const package_mod = b.createModule(.{
.root_source_file = b.path("src/package.zig"),
.target = target,
.optimize = optimize,
});
linkApex(package_mod, b, false);
package_mod.addOptions("build_options", apex_opts);
const package_exe = b.addExecutable(.{
.name = "boris-package",
.root_module = package_mod,
});
b.installArtifact(package_exe);
const package_run = b.addRunArtifact(package_exe);
package_run.setCwd(b.path("."));
package_run.step.dependOn(b.getInstallStep());
if (b.args) |args| {
package_run.addArgs(args);
}
const package_step = b.step(
"package",
"Build a deterministic IR (+ optional RAG) review tar under packages/",
);
package_step.dependOn(&package_run.step);
const package_tests = b.addTest(.{
.root_module = package_mod,
});
const run_package_tests = b.addRunArtifact(package_tests);
run_package_tests.setCwd(b.path("."));
// --- Dependency & Cache tests (Milestone P2.1 & P2.3) ------------------
const include_mod = b.createModule(.{
.root_source_file = b.path("src/include.zig"),
.target = target,
.optimize = optimize,
});
const include_tests = b.addTest(.{
.root_module = include_mod,
});
const run_include_tests = b.addRunArtifact(include_tests);
run_include_tests.setCwd(b.path("."));
const wikilink_mod = b.createModule(.{
.root_source_file = b.path("src/wikilink.zig"),
.target = target,
.optimize = optimize,
});
const wikilink_tests = b.addTest(.{
.root_module = wikilink_mod,
});
const run_wikilink_tests = b.addRunArtifact(wikilink_tests);
run_wikilink_tests.setCwd(b.path("."));
const dependency_mod = b.createModule(.{
.root_source_file = b.path("src/dependency.zig"),
.target = target,
.optimize = optimize,
});
const dependency_tests = b.addTest(.{
.root_module = dependency_mod,
});
const run_dependency_tests = b.addRunArtifact(dependency_tests);
run_dependency_tests.setCwd(b.path("."));
// --- Documentation Intelligence analysis core ------------------------
// Pure graph analysis; CLI wiring remains a separate product slice.
const intelligence_mod = b.createModule(.{
.root_source_file = b.path("src/intelligence.zig"),
.target = target,
.optimize = optimize,
});
const intelligence_tests = b.addTest(.{
.root_module = intelligence_mod,
});
const run_intelligence_tests = b.addRunArtifact(intelligence_tests);
run_intelligence_tests.setCwd(b.path("."));
const cache_mod = b.createModule(.{
.root_source_file = b.path("src/cache.zig"),
.target = target,
.optimize = optimize,
});
const cache_tests = b.addTest(.{
.root_module = cache_mod,
});
const run_cache_tests = b.addRunArtifact(cache_tests);
run_cache_tests.setCwd(b.path("."));
const test_step = b.step("test", "Run unit tests");
test_step.dependOn(&run_unit_tests.step);
test_step.dependOn(&run_fixtures_tests.step);
test_step.dependOn(&run_scanner_tests.step);
test_step.dependOn(&run_parser_tests.step);
test_step.dependOn(&run_textile_tests.step);
test_step.dependOn(&run_pipeline_tests.step);
test_step.dependOn(&run_graph_tests.step);
test_step.dependOn(&run_aside_tests.step);
test_step.dependOn(&run_rag_tests.step);
test_step.dependOn(&run_apex_tests.step);
test_step.dependOn(&run_assemble_tests.step);
test_step.dependOn(&run_theme_tests.step);
test_step.dependOn(&run_content_asset_tests.step);
test_step.dependOn(&run_layout_select_tests.step);
test_step.dependOn(&run_compile_tests.step);
test_step.dependOn(&run_hardening_tests.step);
test_step.dependOn(&run_layout_hostile_tests.step);
test_step.dependOn(&run_fuzz_tests.step);
test_step.dependOn(&run_source_rag_tests.step);
test_step.dependOn(&run_package_tests.step);
test_step.dependOn(&run_dependency_tests.step);
test_step.dependOn(&run_intelligence_tests.step);
test_step.dependOn(&run_cache_tests.step);
test_step.dependOn(&run_include_tests.step);
test_step.dependOn(&run_wikilink_tests.step);
const test_harness_step = b.step(
"test-harness",
"Run hardening integration tests (alias subset of zig build test)",
);
test_harness_step.dependOn(&run_hardening_tests.step);
// Product Apex path requires cmake static libs before compile/link.
// Hostile double intentionally does NOT depend on or link real ApexMarkdown.
const apex_needing = [_]*std.Build.Step{
&exe.step,
&unit_tests.step,
&pipeline_tests.step,
&aside_tests.step,
&rag_tests.step,
&apex_tests.step,
&compile_tests.step,
&scale_smoke_tests.step,
&hardening_tests.step,
&layout_hostile_tests.step,
&fuzz_tests.step,
&package_exe.step,
&package_tests.step,
};
for (apex_needing) |s| s.dependOn(&ensure_apex.step);
}
/// Compile and link host Apex C into a Zig module (in-process; never a subprocess).
///
/// - `hostile == false`: host adapter `vendor/apex/apex.c` + static ApexMarkdown
/// libs (libapex + cmark-gfm). Upstream headers are compile-private to the C TU.
/// - `hostile == true`: `apex_hostile.c` only — no real ApexMarkdown.
fn linkApex(mod: *std.Build.Module, b: *std.Build, hostile: bool) void {
mod.link_libc = true;
// Zig @cImport sees only the Boris host ABI header.
mod.addIncludePath(b.path("vendor/apex"));
if (!hostile) {
// Adapter C TU includes <apex/apex.h>; paths are LazyPath so zig cc
// resolves them regardless of compile cwd. Zig @cImport still only
// needs vendor/apex (host ABI) — do not @cInclude upstream headers.
mod.addIncludePath(b.path("vendor/apex-markdown/include"));
mod.addIncludePath(b.path("vendor/apex-markdown/vendor/cmark-gfm/src"));
mod.addIncludePath(b.path("vendor/apex-markdown/build/vendor/cmark-gfm/src"));
// Static archives from scripts/build-apex-markdown.sh:
mod.addObjectFile(b.path("vendor/apex-markdown/build/libapex.a"));
mod.addObjectFile(b.path("vendor/apex-markdown/build/vendor/cmark-gfm/extensions/libcmark-gfm-extensions.a"));
mod.addObjectFile(b.path("vendor/apex-markdown/build/vendor/cmark-gfm/src/libcmark-gfm.a"));
}
const c_file = if (hostile)
"vendor/apex/apex_hostile.c"
else
"vendor/apex/apex.c";
mod.addCSourceFile(.{
.file = b.path(c_file),
.flags = &.{
"-std=c11",
"-Wall",
"-Wextra",
},
});
}