@@ -245,6 +245,7 @@ fn addDependencies(b: *Build, mod: *Build.Module, opts: *Build.Step.Options) !vo
245245 mod .addCMacro ("HAVE_ASSERT_H" , "1" );
246246 mod .addCMacro ("HAVE_BASENAME" , "1" );
247247 mod .addCMacro ("HAVE_BOOL_T" , "1" );
248+ mod .addCMacro ("HAVE_BROTLI" , "1" );
248249 mod .addCMacro ("HAVE_BUILTIN_AVAILABLE" , "1" );
249250 mod .addCMacro ("HAVE_CLOCK_GETTIME_MONOTONIC" , "1" );
250251 mod .addCMacro ("HAVE_DLFCN_H" , "1" );
@@ -379,6 +380,7 @@ fn addDependencies(b: *Build, mod: *Build.Module, opts: *Build.Step.Options) !vo
379380 }
380381
381382 try buildZlib (b , mod );
383+ try buildBrotli (b , mod );
382384 try buildMbedtls (b , mod );
383385 try buildNghttp2 (b , mod );
384386 try buildCurl (b , mod );
@@ -484,6 +486,30 @@ fn buildZlib(b: *Build, m: *Build.Module) !void {
484486 } });
485487}
486488
489+ fn buildBrotli (b : * Build , m : * Build.Module ) ! void {
490+ const brotli = b .addLibrary (.{
491+ .name = "brotli" ,
492+ .root_module = m ,
493+ });
494+
495+ const root = "vendor/brotli/c/" ;
496+ brotli .addIncludePath (b .path (root ++ "include" ));
497+ brotli .addCSourceFiles (.{ .flags = &.{}, .files = &.{
498+ root ++ "common/constants.c" ,
499+ root ++ "common/context.c" ,
500+ root ++ "common/dictionary.c" ,
501+ root ++ "common/platform.c" ,
502+ root ++ "common/shared_dictionary.c" ,
503+ root ++ "common/transform.c" ,
504+ root ++ "dec/bit_reader.c" ,
505+ root ++ "dec/decode.c" ,
506+ root ++ "dec/huffman.c" ,
507+ root ++ "dec/prefix.c" ,
508+ root ++ "dec/state.c" ,
509+ root ++ "dec/static_init.c" ,
510+ } });
511+ }
512+
487513fn buildMbedtls (b : * Build , m : * Build.Module ) ! void {
488514 const mbedtls = b .addLibrary (.{
489515 .name = "mbedtls" ,
0 commit comments