Skip to content

Commit b91e774

Browse files
cantoniosGoogle-ML-Automation
authored andcommitted
Add pybind_library rule.
For use in upcoming changes that will require it. PiperOrigin-RevId: 716825576
1 parent 75feb03 commit b91e774

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

third_party/bazel/python/pybind11.bzl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,8 @@ def pybind_extension(name, deps, **kwargs):
2020
# Add pybind11 to deps.
2121
deps = collections.uniq(deps + ["@pybind11"])
2222
tsl_pybind_extension_opensource(name = name, deps = deps, **kwargs)
23+
24+
def pybind_library(name, deps, **kwargs):
25+
# Add pybind11 and python headers to deps.
26+
deps = collections.uniq(deps + ["@pybind11", "@local_config_python//:python_headers"])
27+
native.cc_library(name = name, deps = deps, **kwargs)

0 commit comments

Comments
 (0)