Something went wrong. Try again.
Implementations of Privacy Enhancing Technologies in Zig
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475const std = @import("std");
pub fn build(b: *std.Build) void { const target = b.standardTargetOptions(.{}); const optimize = b.standardOptimizeOption(.{});
const pets_mod = b.addModule("pets", .{ .root_source_file = b.path("src/root.zig"),
.target = target, .optimize = optimize, });
const dpf_exe = b.addExecutable(.{ .name = "dpf", .root_module = b.createModule(.{ .root_source_file = b.path("examples/dpf.zig"), .target = target, .optimize = optimize, .imports = &.{ .{ .name = "pets", .module = pets_mod }, }, }), }); b.installArtifact(dpf_exe);
const bench_dpf_n: usize = b.option(usize, "bench-dpf-n", "DPF benchmark domain exponent; size = 2^n") orelse if (optimize == .Debug) 12 else 22; if (bench_dpf_n == 0) @panic("-Dbench-dpf-n must be greater than 0");
const bench_dpf_options = b.addOptions(); bench_dpf_options.addOption(usize, "n", bench_dpf_n);
const dpf_bench_mod = b.createModule(.{ .root_source_file = b.path("examples/bench_dpf.zig"), .target = target, .optimize = optimize, .imports = &.{ .{ .name = "pets", .module = pets_mod }, }, }); dpf_bench_mod.addOptions("bench_options", bench_dpf_options);
const dpf_bench_exe = b.addExecutable(.{ .name = "bench-dpf", .root_module = dpf_bench_mod, });
const run_dpf_step = b.step("run-dpf", "Run the app");
const run_dpf_cmd = b.addRunArtifact(dpf_exe); run_dpf_step.dependOn(&run_dpf_cmd.step); if (b.args) |args| { run_dpf_cmd.addArgs(args); }
run_dpf_cmd.step.dependOn(b.getInstallStep());
const bench_dpf_step = b.step("bench-dpf", "Benchmark DPF full expansion");
const bench_dpf_cmd = b.addRunArtifact(dpf_bench_exe); bench_dpf_step.dependOn(&bench_dpf_cmd.step); if (b.args) |args| { bench_dpf_cmd.addArgs(args); }
const pets_mod_tests = b.addTest(.{ .root_module = pets_mod, });
const run_pets_mod_tests = b.addRunArtifact(pets_mod_tests);
const test_step = b.step("test", "Run tests"); test_step.dependOn(&run_pets_mod_tests.step);}