8000 fix: add the windows `*.lib` interface file to the `python_headers` l… · bazel-contrib/rules_python@a7a15ce · GitHub
[go: up one dir, main page]

Skip to content

Commit a7a15ce

Browse files
committed
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 a7a15ce

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 = "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