diff --git a/src/BUILD b/src/BUILD index 296cbf1112587b..6ffa2c11732377 100644 --- a/src/BUILD +++ b/src/BUILD @@ -341,6 +341,7 @@ filegroup( "//src/main/tools:jdk-support", "//src/main/tools:linux-sandbox", "//tools/osx:xcode-locator", + "//third_party/zstd-jni:target-os-native-lib", ] + select({ "//src/conditions:windows": [], "//conditions:default": [ diff --git a/third_party/zstd-jni/BUILD.bazel b/third_party/zstd-jni/BUILD.bazel index 3757a67e8a5b42..e0644fe8fae5f4 100644 --- a/third_party/zstd-jni/BUILD.bazel +++ b/third_party/zstd-jni/BUILD.bazel @@ -103,6 +103,19 @@ genrule( output_to_bindir = 1, ) +filegroup( + name = "target-os-native-lib", + srcs = select({ + "//src/conditions:darwin": ["//third_party/zstd-jni:libzstd-jni.dylib"], + "//src/conditions:darwin_x86_64": ["//third_party/zstd-jni:libzstd-jni.dylib"], + "//src/conditions:windows": ["//third_party/zstd-jni:libzstd-jni.dll"], + "//conditions:default": ["//third_party/zstd-jni:libzstd-jni.so"], + }), + visibility = [ + "//src:__pkg__", + ], +) + java_library( name = "zstd-jni", srcs = glob( @@ -111,11 +124,6 @@ java_library( ], ), visibility = ["//visibility:public"], - data = select({ - "//src/conditions:darwin": ["//third_party/zstd-jni:libzstd-jni.dylib"], - "//src/conditions:darwin_x86_64": ["//third_party/zstd-jni:libzstd-jni.dylib"], - "//src/conditions:windows": ["//third_party/zstd-jni:libzstd-jni.dll"], - "//conditions:default": ["//third_party/zstd-jni:libzstd-jni.so"], - }), + data = [":target-os-native-lib"], deps = ["@bazel_tools//tools/java/runfiles"], )