@@ -3,28 +3,18 @@ const Build = std.Build;
33const ResolvedTarget = Build .ResolvedTarget ;
44const OptimizeMode = std .builtin .OptimizeMode ;
55
6- const Options = struct {
7- enable_snappy : bool ,
8-
9- fn init (b : * Build ) Options {
10- return .{
11- .enable_snappy = b .option (
12- bool ,
13- "enable_snappy" ,
14- "Enables and builds with the Snappy compressor" ,
15- ) orelse false ,
16- };
17- }
18- };
19-
206pub fn build (b : * Build ) ! void {
217 const target = b .standardTargetOptions (.{});
228 const optimize = b .standardOptimizeOption (.{});
239
24- const options : Options = .init (b );
10+ const enable_snappy = b .option (
11+ bool ,
12+ "enable_snappy" ,
13+ "Enables and builds with the Snappy compressor" ,
14+ ) orelse false ;
2515
2616 // RocksDB's translate-c module
27- const rocksdb_mod = try addRocksDB (b , target , optimize , options );
17+ const rocksdb_mod = try addRocksDB (b , target , optimize , enable_snappy );
2818 const bindings_mod = b .addModule ("bindings" , .{
2919 .target = target ,
3020 .optimize = optimize ,
@@ -48,7 +38,7 @@ fn addRocksDB(
4838 b : * Build ,
4939 target : ResolvedTarget ,
5040 optimize : OptimizeMode ,
51- options : Options ,
41+ enable_snappy : bool ,
5242) ! * Build.Module {
5343 const rocks_dep = b .dependency ("rocksdb" , .{});
5444
@@ -85,7 +75,7 @@ fn addRocksDB(
8575 }),
8676 });
8777
88- const maybe_libsnappy = if (options . enable_snappy ) b .addLibrary (.{
78+ const maybe_libsnappy = if (enable_snappy ) b .addLibrary (.{
8979 .name = "snappy" ,
9080 .linkage = .static ,
9181 .root_module = b .createModule (.{
0 commit comments