mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[bazel] Build and test wpical with bazel (#8155)
This pulls down the prebuilt ceres libraries and uses them with Bazel to build and test wpical. Do note that bazel looks up artifacts used for testing differently than the other build systems. It wants you to use its runfiles API to find the dependencies reliably. Add a function to look up the paths for files, and use runfiles only when building with Bazel to maintain compatibility with other languages. Signed-off-by: Austin Schuh <austin.linux@gmail.com>
This commit is contained in:
@@ -189,6 +189,7 @@ def third_party_cc_lib_helper(
|
||||
include_root,
|
||||
src_root = None,
|
||||
src_excludes = [],
|
||||
defines = [],
|
||||
visibility = None):
|
||||
"""
|
||||
Helper for src / headers pairs that aren't directly compiled, but rather pulled into a bigger library.
|
||||
@@ -212,6 +213,7 @@ def third_party_cc_lib_helper(
|
||||
include_root + "/**",
|
||||
]),
|
||||
includes = [include_root],
|
||||
defines = defines,
|
||||
strip_include_prefix = include_root,
|
||||
visibility = visibility,
|
||||
)
|
||||
@@ -292,6 +294,7 @@ def wpilib_cc_library(
|
||||
srcs = srcs + [lib + "-srcs" for lib in third_party_libraries],
|
||||
deps = deps + [lib + "-headers" for lib in third_party_libraries + third_party_header_only_libraries],
|
||||
strip_include_prefix = strip_include_prefix,
|
||||
linkopts = linkopts,
|
||||
**kwargs
|
||||
)
|
||||
|
||||
|
||||
@@ -353,6 +353,7 @@ def package_binary_cc_project(
|
||||
name,
|
||||
maven_group_id,
|
||||
maven_artifact_name,
|
||||
extra_files = [],
|
||||
architectures = None,
|
||||
renames = None):
|
||||
"""Packages the C++ binary targets for a project.
|
||||
@@ -374,7 +375,7 @@ def package_binary_cc_project(
|
||||
srcs = [
|
||||
":{}-files".format(name),
|
||||
"//:license_pkg_files",
|
||||
],
|
||||
] + extra_files,
|
||||
architectures = architectures,
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user