zig fmt build.zig

This commit is contained in:
Pierre Tachoire
2025-08-14 11:27:31 +02:00
parent 96b10f4b85
commit 1e095fede5

336
build.zig
View File

@@ -163,7 +163,6 @@ fn common(b: *Build, opts: *Build.Step.Options, step: *Build.Step.Compile) !void
v8_mod.addOptions("default_exports", v8_opts); v8_mod.addOptions("default_exports", v8_opts);
mod.addImport("v8", v8_mod); mod.addImport("v8", v8_mod);
const release_dir = if (mod.optimize.? == .Debug) "debug" else "release"; const release_dir = if (mod.optimize.? == .Debug) "debug" else "release";
const os = switch (target.result.os.tag) { const os = switch (target.result.os.tag) {
.linux => "linux", .linux => "linux",
@@ -452,30 +451,27 @@ fn buildZlib(b: *Build, m: *Build.Module) !void {
const root = "vendor/zlib/"; const root = "vendor/zlib/";
zlib.installHeader(b.path(root ++ "zlib.h"), "zlib.h"); zlib.installHeader(b.path(root ++ "zlib.h"), "zlib.h");
zlib.installHeader(b.path(root ++ "zconf.h"), "zconf.h"); zlib.installHeader(b.path(root ++ "zconf.h"), "zconf.h");
zlib.addCSourceFiles(.{ zlib.addCSourceFiles(.{ .flags = &.{
.flags = &.{ "-DHAVE_SYS_TYPES_H",
"-DHAVE_SYS_TYPES_H", "-DHAVE_STDINT_H",
"-DHAVE_STDINT_H", "-DHAVE_STDDEF_H",
"-DHAVE_STDDEF_H", }, .files = &.{
}, root ++ "adler32.c",
.files = &.{ root ++ "compress.c",
root ++ "adler32.c", root ++ "crc32.c",
root ++ "compress.c", root ++ "deflate.c",
root ++ "crc32.c", root ++ "gzclose.c",
root ++ "deflate.c", root ++ "gzlib.c",
root ++ "gzclose.c", root ++ "gzread.c",
root ++ "gzlib.c", root ++ "gzwrite.c",
root ++ "gzread.c", root ++ "inflate.c",
root ++ "gzwrite.c", root ++ "infback.c",
root ++ "inflate.c", root ++ "inftrees.c",
root ++ "infback.c", root ++ "inffast.c",
root ++ "inftrees.c", root ++ "trees.c",
root ++ "inffast.c", root ++ "uncompr.c",
root ++ "trees.c", root ++ "zutil.c",
root ++ "uncompr.c", } });
root ++ "zutil.c",
}
});
} }
fn buildMbedtls(b: *Build, m: *Build.Module) !void { fn buildMbedtls(b: *Build, m: *Build.Module) !void {
@@ -488,118 +484,114 @@ fn buildMbedtls(b: *Build, m: *Build.Module) !void {
mbedtls.addIncludePath(b.path(root ++ "include")); mbedtls.addIncludePath(b.path(root ++ "include"));
mbedtls.addIncludePath(b.path(root ++ "library")); mbedtls.addIncludePath(b.path(root ++ "library"));
mbedtls.addCSourceFiles(.{ mbedtls.addCSourceFiles(.{ .flags = &.{}, .files = &.{
.flags = &.{ root ++ "library/aes.c",
}, root ++ "library/aesni.c",
.files = &.{ root ++ "library/aesce.c",
root ++ "library/aes.c", root ++ "library/aria.c",
root ++ "library/aesni.c", root ++ "library/asn1parse.c",
root ++ "library/aesce.c", root ++ "library/asn1write.c",
root ++ "library/aria.c", root ++ "library/base64.c",
root ++ "library/asn1parse.c", root ++ "library/bignum.c",
root ++ "library/asn1write.c", root ++ "library/bignum_core.c",
root ++ "library/base64.c", root ++ "library/bignum_mod.c",
root ++ "library/bignum.c", root ++ "library/bignum_mod_raw.c",
root ++ "library/bignum_core.c", root ++ "library/camellia.c",
root ++ "library/bignum_mod.c", root ++ "library/ccm.c",
root ++ "library/bignum_mod_raw.c", root ++ "library/chacha20.c",
root ++ "library/camellia.c", root ++ "library/chachapoly.c",
root ++ "library/ccm.c", root ++ "library/cipher.c",
root ++ "library/chacha20.c", root ++ "library/cipher_wrap.c",
root ++ "library/chachapoly.c", root ++ "library/constant_time.c",
root ++ "library/cipher.c", root ++ "library/cmac.c",
root ++ "library/cipher_wrap.c", root ++ "library/ctr_drbg.c",
root ++ "library/constant_time.c", root ++ "library/des.c",
root ++ "library/cmac.c", root ++ "library/dhm.c",
root ++ "library/ctr_drbg.c", root ++ "library/ecdh.c",
root ++ "library/des.c", root ++ "library/ecdsa.c",
root ++ "library/dhm.c", root ++ "library/ecjpake.c",
root ++ "library/ecdh.c", root ++ "library/ecp.c",
root ++ "library/ecdsa.c", root ++ "library/ecp_curves.c",
root ++ "library/ecjpake.c", root ++ "library/entropy.c",
root ++ "library/ecp.c", root ++ "library/entropy_poll.c",
root ++ "library/ecp_curves.c", root ++ "library/error.c",
root ++ "library/entropy.c", root ++ "library/gcm.c",
root ++ "library/entropy_poll.c", root ++ "library/hkdf.c",
root ++ "library/error.c", root ++ "library/hmac_drbg.c",
root ++ "library/gcm.c", root ++ "library/lmots.c",
root ++ "library/hkdf.c", root ++ "library/lms.c",
root ++ "library/hmac_drbg.c", root ++ "library/md.c",
root ++ "library/lmots.c", root ++ "library/md5.c",
root ++ "library/lms.c", root ++ "library/memory_buffer_alloc.c",
root ++ "library/md.c", root ++ "library/nist_kw.c",
root ++ "library/md5.c", root ++ "library/oid.c",
root ++ "library/memory_buffer_alloc.c", root ++ "library/padlock.c",
root ++ "library/nist_kw.c", root ++ "library/pem.c",
root ++ "library/oid.c", root ++ "library/pk.c",
root ++ "library/padlock.c", root ++ "library/pk_ecc.c",
root ++ "library/pem.c", root ++ "library/pk_wrap.c",
root ++ "library/pk.c", root ++ "library/pkcs12.c",
root ++ "library/pk_ecc.c", root ++ "library/pkcs5.c",
root ++ "library/pk_wrap.c", root ++ "library/pkparse.c",
root ++ "library/pkcs12.c", root ++ "library/pkwrite.c",
root ++ "library/pkcs5.c", root ++ "library/platform.c",
root ++ "library/pkparse.c", root ++ "library/platform_util.c",
root ++ "library/pkwrite.c", root ++ "library/poly1305.c",
root ++ "library/platform.c", root ++ "library/psa_crypto.c",
root ++ "library/platform_util.c", root ++ "library/psa_crypto_aead.c",
root ++ "library/poly1305.c", root ++ "library/psa_crypto_cipher.c",
root ++ "library/psa_crypto.c", root ++ "library/psa_crypto_client.c",
root ++ "library/psa_crypto_aead.c", root ++ "library/psa_crypto_ffdh.c",
root ++ "library/psa_crypto_cipher.c", root ++ "library/psa_crypto_driver_wrappers_no_static.c",
root ++ "library/psa_crypto_client.c", root ++ "library/psa_crypto_ecp.c",
root ++ "library/psa_crypto_ffdh.c", root ++ "library/psa_crypto_hash.c",
root ++ "library/psa_crypto_driver_wrappers_no_static.c", root ++ "library/psa_crypto_mac.c",
root ++ "library/psa_crypto_ecp.c", root ++ "library/psa_crypto_pake.c",
root ++ "library/psa_crypto_hash.c", root ++ "library/psa_crypto_rsa.c",
root ++ "library/psa_crypto_mac.c", root ++ "library/psa_crypto_se.c",
root ++ "library/psa_crypto_pake.c", root ++ "library/psa_crypto_slot_management.c",
root ++ "library/psa_crypto_rsa.c", root ++ "library/psa_crypto_storage.c",
root ++ "library/psa_crypto_se.c", root ++ "library/psa_its_file.c",
root ++ "library/psa_crypto_slot_management.c", root ++ "library/psa_util.c",
root ++ "library/psa_crypto_storage.c", root ++ "library/ripemd160.c",
root ++ "library/psa_its_file.c", root ++ "library/rsa.c",
root ++ "library/psa_util.c", root ++ "library/rsa_alt_helpers.c",
root ++ "library/ripemd160.c", root ++ "library/sha1.c",
root ++ "library/rsa.c", root ++ "library/sha3.c",
root ++ "library/rsa_alt_helpers.c", root ++ "library/sha256.c",
root ++ "library/sha1.c", root ++ "library/sha512.c",
root ++ "library/sha3.c", root ++ "library/threading.c",
root ++ "library/sha256.c", root ++ "library/timing.c",
root ++ "library/sha512.c", root ++ "library/version.c",
root ++ "library/threading.c", root ++ "library/version_features.c",
root ++ "library/timing.c", root ++ "library/pkcs7.c",
root ++ "library/version.c", root ++ "library/x509.c",
root ++ "library/version_features.c", root ++ "library/x509_create.c",
root ++ "library/pkcs7.c", root ++ "library/x509_crl.c",
root ++ "library/x509.c", root ++ "library/x509_crt.c",
root ++ "library/x509_create.c", root ++ "library/x509_csr.c",
root ++ "library/x509_crl.c", root ++ "library/x509write.c",
root ++ "library/x509_crt.c", root ++ "library/x509write_crt.c",
root ++ "library/x509_csr.c", root ++ "library/x509write_csr.c",
root ++ "library/x509write.c", root ++ "library/debug.c",
root ++ "library/x509write_crt.c", root ++ "library/mps_reader.c",
root ++ "library/x509write_csr.c", root ++ "library/mps_trace.c",
root ++ "library/debug.c", root ++ "library/net_sockets.c",
root ++ "library/mps_reader.c", root ++ "library/ssl_cache.c",
root ++ "library/mps_trace.c", root ++ "library/ssl_ciphersuites.c",
root ++ "library/net_sockets.c", root ++ "library/ssl_client.c",
root ++ "library/ssl_cache.c", root ++ "library/ssl_cookie.c",
root ++ "library/ssl_ciphersuites.c", root ++ "library/ssl_debug_helpers_generated.c",
root ++ "library/ssl_client.c", root ++ "library/ssl_msg.c",
root ++ "library/ssl_cookie.c", root ++ "library/ssl_ticket.c",
root ++ "library/ssl_debug_helpers_generated.c", root ++ "library/ssl_tls.c",
root ++ "library/ssl_msg.c", root ++ "library/ssl_tls12_client.c",
root ++ "library/ssl_ticket.c", root ++ "library/ssl_tls12_server.c",
root ++ "library/ssl_tls.c", root ++ "library/ssl_tls13_keys.c",
root ++ "library/ssl_tls12_client.c", root ++ "library/ssl_tls13_server.c",
root ++ "library/ssl_tls12_server.c", root ++ "library/ssl_tls13_client.c",
root ++ "library/ssl_tls13_keys.c", root ++ "library/ssl_tls13_generic.c",
root ++ "library/ssl_tls13_server.c", } });
root ++ "library/ssl_tls13_client.c",
root ++ "library/ssl_tls13_generic.c",
}
});
} }
fn buildNghttp2(b: *Build, m: *Build.Module) !void { fn buildNghttp2(b: *Build, m: *Build.Module) !void {
@@ -611,41 +603,38 @@ fn buildNghttp2(b: *Build, m: *Build.Module) !void {
const root = "vendor/nghttp2/"; const root = "vendor/nghttp2/";
nghttp2.addIncludePath(b.path(root ++ "lib")); nghttp2.addIncludePath(b.path(root ++ "lib"));
nghttp2.addIncludePath(b.path(root ++ "lib/includes")); nghttp2.addIncludePath(b.path(root ++ "lib/includes"));
nghttp2.addCSourceFiles(.{ nghttp2.addCSourceFiles(.{ .flags = &.{
.flags = &.{ "-DNGHTTP2_STATICLIB",
"-DNGHTTP2_STATICLIB", "-DHAVE_NETINET_IN",
"-DHAVE_NETINET_IN", "-DHAVE_TIME_H",
"-DHAVE_TIME_H", }, .files = &.{
}, root ++ "lib/sfparse.c",
.files = &.{ root ++ "lib/nghttp2_alpn.c",
root ++ "lib/sfparse.c", root ++ "lib/nghttp2_buf.c",
root ++ "lib/nghttp2_alpn.c", root ++ "lib/nghttp2_callbacks.c",
root ++ "lib/nghttp2_buf.c", root ++ "lib/nghttp2_debug.c",
root ++ "lib/nghttp2_callbacks.c", root ++ "lib/nghttp2_extpri.c",
root ++ "lib/nghttp2_debug.c", root ++ "lib/nghttp2_frame.c",
root ++ "lib/nghttp2_extpri.c", root ++ "lib/nghttp2_hd.c",
root ++ "lib/nghttp2_frame.c", root ++ "lib/nghttp2_hd_huffman.c",
root ++ "lib/nghttp2_hd.c", root ++ "lib/nghttp2_hd_huffman_data.c",
root ++ "lib/nghttp2_hd_huffman.c", root ++ "lib/nghttp2_helper.c",
root ++ "lib/nghttp2_hd_huffman_data.c", root ++ "lib/nghttp2_http.c",
root ++ "lib/nghttp2_helper.c", root ++ "lib/nghttp2_map.c",
root ++ "lib/nghttp2_http.c", root ++ "lib/nghttp2_mem.c",
root ++ "lib/nghttp2_map.c", root ++ "lib/nghttp2_option.c",
root ++ "lib/nghttp2_mem.c", root ++ "lib/nghttp2_outbound_item.c",
root ++ "lib/nghttp2_option.c", root ++ "lib/nghttp2_pq.c",
root ++ "lib/nghttp2_outbound_item.c", root ++ "lib/nghttp2_priority_spec.c",
root ++ "lib/nghttp2_pq.c", root ++ "lib/nghttp2_queue.c",
root ++ "lib/nghttp2_priority_spec.c", root ++ "lib/nghttp2_rcbuf.c",
root ++ "lib/nghttp2_queue.c", root ++ "lib/nghttp2_session.c",
root ++ "lib/nghttp2_rcbuf.c", root ++ "lib/nghttp2_stream.c",
root ++ "lib/nghttp2_session.c", root ++ "lib/nghttp2_submit.c",
root ++ "lib/nghttp2_stream.c", root ++ "lib/nghttp2_version.c",
root ++ "lib/nghttp2_submit.c", root ++ "lib/nghttp2_ratelim.c",
root ++ "lib/nghttp2_version.c", root ++ "lib/nghttp2_time.c",
root ++ "lib/nghttp2_ratelim.c", } });
root ++ "lib/nghttp2_time.c",
}
});
} }
fn buildCurl(b: *Build, m: *Build.Module) !void { fn buildCurl(b: *Build, m: *Build.Module) !void {
@@ -659,8 +648,7 @@ fn buildCurl(b: *Build, m: *Build.Module) !void {
curl.addIncludePath(b.path(root ++ "lib")); curl.addIncludePath(b.path(root ++ "lib"));
curl.addIncludePath(b.path(root ++ "include")); curl.addIncludePath(b.path(root ++ "include"));
curl.addCSourceFiles(.{ curl.addCSourceFiles(.{
.flags = &.{ .flags = &.{},
},
.files = &.{ .files = &.{
root ++ "lib/altsvc.c", root ++ "lib/altsvc.c",
root ++ "lib/amigaos.c", root ++ "lib/amigaos.c",