From 3ba99e32cd6ecbbcf27ddd638209f1e0ccf5316b Mon Sep 17 00:00:00 2001 From: Vincent Rischmann Date: Sun, 18 Sep 2022 02:17:23 +0200 Subject: build: add the preprocess-files tool --- build.zig | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'build.zig') diff --git a/build.zig b/build.zig index 0e3b025..71417e2 100644 --- a/build.zig +++ b/build.zig @@ -183,6 +183,21 @@ pub fn build(b: *std.build.Builder) !void { const target = b.standardTargetOptions(.{}); const mode = b.standardReleaseOptions(); + // Tool to preprocess the sqlite header files. + // + // Due to limitations of translate-c the standard header files can't be used for building loadable extensions + // so we have this tool which creates usable header files. + + const preprocess_files_tool = b.addExecutable("preprocess-files", "tools/preprocess_files.zig"); + preprocess_files_tool.setBuildMode(mode); + preprocess_files_tool.setTarget(getTarget(target, true)); + + // Add a top-level step to run the preprocess-files tool + const preprocess_files_run = b.step("preprocess-files", "Run the preprocess-files tool"); + + const preprocess_files_tool_run = preprocess_files_tool.run(); + preprocess_files_run.dependOn(&preprocess_files_tool_run.step); + // If the target is native we assume the user didn't change it with -Dtarget and run all test targets. // Otherwise we run a single test target. const test_targets = if (target.isNative()) -- cgit v1.2.3