mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-06 03:31:43 +00:00
[bazel] Build a single maven artifact bundle (#8049)
Signed-off-by: Austin Schuh <austin.linux@gmail.com> Co-authored-by: PJ Reiniger <pj.reiniger@gmail.com> Co-authored-by: David Vo <auscompgeek@users.noreply.github.com>
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
load("@build_bazel_apple_support//rules:universal_binary.bzl", "universal_binary")
|
||||
load("@rules_cc//cc:action_names.bzl", "CPP_LINK_STATIC_LIBRARY_ACTION_NAME")
|
||||
load("@rules_cc//cc:cc_shared_library.bzl", "cc_shared_library")
|
||||
load("@rules_cc//cc:defs.bzl", "CcInfo", "cc_library")
|
||||
load("@rules_cc//cc:find_cc_toolchain.bzl", "CC_TOOLCHAIN_ATTRS", "find_cpp_toolchain", "use_cc_toolchain")
|
||||
load("@rules_cc//cc/common:cc_common.bzl", "cc_common")
|
||||
@@ -153,26 +155,38 @@ def wpilib_cc_shared_library(
|
||||
name,
|
||||
auto_export_windows_symbols = True,
|
||||
**kwargs):
|
||||
folder, lib = _folder_prefix(name)
|
||||
|
||||
features = []
|
||||
if auto_export_windows_symbols:
|
||||
features.append("windows_export_all_symbols")
|
||||
|
||||
native.cc_shared_library(
|
||||
cc_shared_library(
|
||||
name = name,
|
||||
features = features,
|
||||
**kwargs
|
||||
)
|
||||
|
||||
pkg_files(
|
||||
name = name + "-shared.pkg",
|
||||
srcs = [":" + name],
|
||||
tags = ["manual"],
|
||||
universal_name = "universal/lib" + lib + ".lib"
|
||||
universal_binary(
|
||||
name = universal_name,
|
||||
binary = name,
|
||||
target_compatible_with = [
|
||||
"@platforms//os:osx",
|
||||
],
|
||||
)
|
||||
|
||||
pkg_zip(
|
||||
name = name + "-shared-zip",
|
||||
srcs = ["//:license_pkg_files", name + "-shared.pkg"],
|
||||
tags = ["no-remote", "manual"],
|
||||
pkg_files(
|
||||
name = folder + "/lib" + lib + "-shared-files",
|
||||
srcs = select({
|
||||
"@rules_bzlmodrio_toolchains//conditions:osx": [universal_name],
|
||||
"//conditions:default": [
|
||||
":" + name,
|
||||
],
|
||||
}),
|
||||
strip_prefix = select({
|
||||
"@rules_bzlmodrio_toolchains//conditions:osx": "universal",
|
||||
"//conditions:default": folder,
|
||||
}),
|
||||
)
|
||||
|
||||
CcStaticLibraryInfo = provider(
|
||||
|
||||
Reference in New Issue
Block a user