8000 fix: windows `*.lib` interface in `python_headers` (#976) · lpulley/rules_python@ba45af0 · GitHub
[go: up one dir, main page]

Skip to content

Commit ba45af0

Browse files
author
Lukas
authored
fix: windows *.lib interface in python_headers (bazel-contrib#976)
fix: add the windows `*.lib` interface file to the `python_headers` library A user might use `python_headers` to build an extension module that does not itself pull in the python shared library. On Windows, this needs to expose the `*.lib` interface file to compile correctly.
1 parent 0ee2a7e commit ba45af0

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

python/repositories.bzl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,13 +246,23 @@ filegroup(
246246
),
247247
)
248248
249+
cc_import(
250+
name = "interface",
251+
interface_library 8000 = "libs/python{python_version_nodot}.lib",
252+
system_provided = True,
253+
)
254+
249255
filegroup(
250256
name = "includes",
251257
srcs = glob(["include/**/*.h"]),
252258
)
253259
254260
cc_library(
255261
name = "python_headers",
262+
deps = select({{
263+
"@bazel_tools//src/conditions:windows": [":interface"],
264+
"//conditions:default": None,
265+
}}),
256266
hdrs = [":includes"],
257267
includes = [
258268
"include",

0 commit comments

Comments
 (0)
0