1package(
2    default_visibility = ["//visibility:public"],
3)
4
5# >>> JNI headers
6
7genrule(
8    name = "copy_link_jni_header",
9    srcs = ["@openjdk_jni_h//file"],
10    outs = ["jni/jni.h"],
11    cmd = "cp -f $< $@",
12)
13
14genrule(
15    name = "copy_link_jni_md_header",
16    srcs = select({
17        "@org_brotli//:darwin": ["@openjdk_macosx_jni_md_h//file"],
18        "@org_brotli//:darwin_x86_64": ["@openjdk_macosx_jni_md_h//file"],
19        "@org_brotli//:windows_msys": ["@openjdk_windows_jni_md_h//file"],
20        "@org_brotli//:windows_msvc": ["@openjdk_windows_jni_md_h//file"],
21        "@org_brotli//:windows": ["@openjdk_windows_jni_md_h//file"],
22        "//conditions:default": ["@openjdk_solaris_jni_md_h//file"],
23    }),
24    outs = ["jni/jni_md.h"],
25    cmd = "cp -f $< $@",
26)
27
28cc_library(
29    name = "jni_inc",
30    hdrs = [
31        ":jni/jni.h",
32        ":jni/jni_md.h",
33    ],
34    includes = ["jni"],
35)
36
37# <<< JNI headers
38
39########################################################
40# WARNING: do not (transitively) depend on this target!
41########################################################
42cc_binary(
43    name = "brotli_jni.dll",
44    srcs = [
45        "//org/brotli/wrapper/common:jni_src",
46        "//org/brotli/wrapper/dec:jni_src",
47        "//org/brotli/wrapper/enc:jni_src",
48        "@org_brotli//:common_headers",
49        "@org_brotli//:common_sources",
50        "@org_brotli//:dec_headers",
51        "@org_brotli//:dec_sources",
52        "@org_brotli//:enc_headers",
53        "@org_brotli//:enc_sources",
54    ],
55    linkshared = 1,
56    deps = [
57        ":jni_inc",
58        "@org_brotli//:brotli_inc",
59    ],
60)
61
62########################################################
63# WARNING: do not (transitively) depend on this target!
64########################################################
65cc_binary(
66    name = "brotli_jni_no_dictionary_data.dll",
67    srcs = [
68        "//org/brotli/wrapper/common:jni_src",
69        "//org/brotli/wrapper/dec:jni_src",
70        "//org/brotli/wrapper/enc:jni_src",
71        "@org_brotli//:common_headers",
72        "@org_brotli//:common_sources",
73        "@org_brotli//:dec_headers",
74        "@org_brotli//:dec_sources",
75        "@org_brotli//:enc_headers",
76        "@org_brotli//:enc_sources",
77    ],
78    defines = [
79        "BROTLI_EXTERNAL_DICTIONARY_DATA=",
80    ],
81    linkshared = 1,
82    deps = [
83        ":jni_inc",
84        "@org_brotli//:brotli_inc",
85    ],
86)
87