Skip to content

Commit

Permalink
fix: add the windows *.lib interface file to the python_headers l…
Browse files Browse the repository at this point in the history
…ibrary

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.
  • Loading branch information
lummax committed Jan 24, 2023
1 parent 0ee2a7e commit a7a15ce
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions python/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -246,13 +246,23 @@ filegroup(
),
)
cc_import(
name = "interface",
interface_library = "libs/python{python_version_nodot}.lib",
system_provided = True,
)
filegroup(
name = "includes",
srcs = glob(["include/**/*.h"]),
)
cc_library(
name = "python_headers",
deps = select({{
"@bazel_tools//src/conditions:windows": [":interface"],
"//conditions:default": None,
}}),
hdrs = [":includes"],
includes = [
"include",
Expand Down

0 comments on commit a7a15ce

Please sign in to comment.