summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Vincent Rischmann2022-09-18 02:17:23 +0200
committerGravatar Vincent Rischmann2022-09-18 02:30:19 +0200
commit3ba99e32cd6ecbbcf27ddd638209f1e0ccf5316b (patch)
tree36b1be96b0b4f0911187a047e164c875856c9411
parentadd a tool to preprocess files (diff)
downloadzig-sqlite-3ba99e32cd6ecbbcf27ddd638209f1e0ccf5316b.tar.gz
zig-sqlite-3ba99e32cd6ecbbcf27ddd638209f1e0ccf5316b.tar.xz
zig-sqlite-3ba99e32cd6ecbbcf27ddd638209f1e0ccf5316b.zip
build: add the preprocess-files tool
-rw-r--r--build.zig15
1 files changed, 15 insertions, 0 deletions
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 {
183 const target = b.standardTargetOptions(.{}); 183 const target = b.standardTargetOptions(.{});
184 const mode = b.standardReleaseOptions(); 184 const mode = b.standardReleaseOptions();
185 185
186 // Tool to preprocess the sqlite header files.
187 //
188 // Due to limitations of translate-c the standard header files can't be used for building loadable extensions
189 // so we have this tool which creates usable header files.
190
191 const preprocess_files_tool = b.addExecutable("preprocess-files", "tools/preprocess_files.zig");
192 preprocess_files_tool.setBuildMode(mode);
193 preprocess_files_tool.setTarget(getTarget(target, true));
194
195 // Add a top-level step to run the preprocess-files tool
196 const preprocess_files_run = b.step("preprocess-files", "Run the preprocess-files tool");
197
198 const preprocess_files_tool_run = preprocess_files_tool.run();
199 preprocess_files_run.dependOn(&preprocess_files_tool_run.step);
200
186 // If the target is native we assume the user didn't change it with -Dtarget and run all test targets. 201 // If the target is native we assume the user didn't change it with -Dtarget and run all test targets.
187 // Otherwise we run a single test target. 202 // Otherwise we run a single test target.
188 const test_targets = if (target.isNative()) 203 const test_targets = if (target.isNative())