8000 feat: cc_import for libpython · bazel-contrib/rules_python@b02f839 · GitHub
[go: up one dir, main page]

Skip to content

Commit b02f839

Browse files
committed
feat: cc_import for libpython
Signed-off-by: Thulio Ferraz Assis <3149049+f0rmiga@users.noreply.github.com>
1 parent 4c961d9 commit b02f839

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

python/private/toolchains_repo.bzl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ package(default_visibility = ["//visibility:public"])
9090
exports_files(["defs.bzl"])
9191
alias(name = "files", actual = "@{py_repository}_{host_platform}//:files")
9292
alias(name = "includes", actual = "@{py_repository}_{host_platform}//:includes")
93+
alias(name = "libpython", actual = "@{py_repository}_{host_platform}//:libpython")
9394
alias(name = "py3_runtime", actual = "@{py_repository}_{host_platform}//:py3_runtime")
9495
alias(name = "python_headers", actual = "@{py_repository}_{host_platform}//:python_headers")
9596
alias(name = "python_runtimes", actual = "@{py_repository}_{host_platform}//:python_runtimes")

python/repositories.bzl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,15 @@ cc_library(
148148
],
149149
)
150150
151+
cc_import(
152+
name = "libpython",
153+
hdrs = [":includes"],
154+
shared_library = glob([
155+
"lib/libpython*.so", # Linux and macOS
156+
"python3.dll", # Windows
157+
])[0],
158+
)
159+
151160
exports_files(["{python_path}"])
152161
153162
py_runtime(

0 commit comments

Comments
 (0)
0