I have a cc_library
like so:
cc_library(
name = "math",
hdrs = [ "math.h" ],
srcs = [ "math.c" ],
)
Now, I want to make a zip file that contains shared libraries for macOS, Linux and Windows. It should be arranged so that each shared library is in a subfolder named after the platform.
I want something that looks like this:
load("@rules_pkg//:pkg.bzl", "pkg_zip")
# Not real code
pkg_zip(
name = "fat_bundle",
srcs = {
"runtimes/macos-x64/native/libmath.dylib": ":math#macos_x64,shared",
"runtimes/linux-x64/native/libmath.so": ":math#linux_x64,shared",
"runtimes/win-x64/native/math.dll": ":math#windows_x64,shared",
},
)
However the above is not valid Bazel.
How can I achieve this?