Hash :
1e7ea1d8
Author :
Date :
2018-06-04T17:53:16
Inverse bazel project/workspace tree (#677) * Inverse bazel workspace tree. Now each subproject directly depends on root (c) project. This helps to mitigate Bazel bug bazelbuild/bazel#2391; short summary: Bazel does not work if referenced subproject `WORKSPACE` uses any repositories that embedding project does not. Bright side: building C project is much faster; no need to download closure, go and JDK...
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
package(
default_visibility = ["//visibility:public"],
)
# >>> JNI headers
genrule(
name = "copy_link_jni_header",
srcs = ["@openjdk_linux//:jni_h"],
outs = ["jni/jni.h"],
cmd = "cp -f $< $@",
)
genrule(
name = "copy_link_jni_md_header",
srcs = select({
"@org_brotli//:darwin": ["@openjdk_macos//:jni_md_h"],
"@org_brotli//:darwin_x86_64": ["@openjdk_macos//:jni_md_h"],
"@org_brotli//:windows_msys": ["@openjdk_win//:jni_md_h"],
"@org_brotli//:windows_msvc": ["@openjdk_win//:jni_md_h"],
"@org_brotli//:windows": ["@openjdk_win//:jni_md_h"],
"//conditions:default": ["@openjdk_linux//:jni_md_h"],
}),
outs = ["jni/jni_md.h"],
cmd = "cp -f $< $@",
)
cc_library(
name = "jni_inc",
hdrs = [
":jni/jni.h",
":jni/jni_md.h",
],
includes = ["jni"],
)
# <<< JNI headers
########################################################
# WARNING: do not (transitively) depend on this target!
########################################################
cc_binary(
name = "brotli_jni.dll",
srcs = [
"@org_brotli//:common_headers",
"@org_brotli//:common_sources",
"@org_brotli//:dec_headers",
"@org_brotli//:dec_sources",
"@org_brotli//:enc_headers",
"@org_brotli//:enc_sources",
"//org/brotli/wrapper/common:jni_src",
"//org/brotli/wrapper/dec:jni_src",
"//org/brotli/wrapper/enc:jni_src",
],
deps = [
"@org_brotli//:brotli_inc",
":jni_inc",
],
linkshared = 1,
)
########################################################
# WARNING: do not (transitively) depend on this target!
########################################################
cc_binary(
name = "brotli_jni_no_dictionary_data.dll",
srcs = [
"@org_brotli//:common_headers",
"@org_brotli//:common_sources",
"@org_brotli//:dec_headers",
"@org_brotli//:dec_sources",
"@org_brotli//:enc_headers",
"@org_brotli//:enc_sources",
"//org/brotli/wrapper/common:jni_src",
"//org/brotli/wrapper/dec:jni_src",
"//org/brotli/wrapper/enc:jni_src",
],
defines = [
"BROTLI_EXTERNAL_DICTIONARY_DATA=",
],
deps = [
"@org_brotli//:brotli_inc",
":jni_inc",
],
linkshared = 1,
)