diff --git a/BUILD b/BUILD new file mode 100644 index 00000000..991cb183 --- a/BUILD +++ b/BUILD @@ -0,0 +1,55 @@ +load("@rules_foreign_cc//foreign_cc:defs.bzl", "cmake") +load("@rules_license//rules:license.bzl", "license") + +package( + default_applicable_licenses = [":license"], + default_visibility = ["//visibility:public"], +) + +license( + name = "license", + package_name = "libzip", +) + +filegroup( + name = "all_srcs", + srcs = glob(["**"]), +) + +cmake( + name = "libzip", + build_args = [ + "-j4", + ], + cache_entries = { + "BUILD_SHARED_LIBS": "OFF", + "BUILD_DOC": "OFF", + "BUILD_EXAMPLES": "OFF", + "BUILD_OSSFUZZ": "OFF", + "BUILD_REGRESS": "OFF", + "BUILD_TOOLS": "OFF", + "ENABLE_BZIP2": "OFF", + "ENABLE_COMMONCRYPTO": "OFF", + "ENABLE_GNUTLS": "OFF", + "ENABLE_LZMA": "OFF", + "ENABLE_MBEDTLS": "OFF", + "ENABLE_WINDOWS_CRYPTO": "OFF", + "CMAKE_INSTALL_LIBDIR": "lib", + }, + copts = ["-w"], + env = { + "CMAKE_BUILD_TYPE": "Release", + "CMAKE_BUILD_PARALLEL_LEVEL": "4", + }, + includes = [ + ".", + "lib", + ], + lib_source = ":all_srcs", + out_static_libs = ["libzip.a"], + deps = [ + "@boringssl//:crypto", + "@zstd", + "@zlib", + ], +) \ No newline at end of file