[bazel] Simple shared library implementation (#8044)

This commit is contained in:
PJ Reiniger
2025-07-02 01:53:34 -04:00
committed by GitHub
parent 6d92e2501d
commit 1ccafdc13f
16 changed files with 331 additions and 17 deletions

View File

@@ -149,6 +149,32 @@ def wpilib_cc_library(
tags = ["no-remote"],
)
def wpilib_cc_shared_library(
name,
auto_export_windows_symbols = True,
**kwargs):
features = []
if auto_export_windows_symbols:
features.append("windows_export_all_symbols")
native.cc_shared_library(
name = name,
features = features,
**kwargs
)
pkg_files(
name = name + "-shared.pkg",
srcs = [":" + name],
tags = ["manual"],
)
pkg_zip(
name = name + "-shared-zip",
srcs = ["//:license_pkg_files", name + "-shared.pkg"],
tags = ["no-remote", "manual"],
)
CcStaticLibraryInfo = provider(
"Information about a cc static library.",
fields = {
@@ -348,3 +374,15 @@ def wpilib_cc_static_library(
static_lib_name = static_lib_name,
**kwargs
)
pkg_files(
name = name + "-static.pkg",
srcs = [":" + name],
tags = ["manual"],
)
pkg_zip(
name = name + "-static-zip",
srcs = ["//:license_pkg_files", name + "-static.pkg"],
tags = ["no-remote", "manual"],
)