• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Adapted with modifications from tensorflow/third_party/py/
2
3package(default_visibility=["//visibility:public"])
4
5# To build Python C/C++ extension on Windows, we need to link to python import library pythonXY.lib
6# See https://docs.python.org/3/extending/windows.html
7cc_import(
8    name="python_lib",
9    interface_library=select({
10        ":windows": ":python_import_lib",
11        # A placeholder for Unix platforms which makes --no_build happy.
12        "//conditions:default": "not-existing.lib",
13    }),
14    system_provided=1,
15)
16
17cc_library(
18    name="python_headers",
19    hdrs=[":python_include"],
20    deps=select({
21        ":windows": [":python_lib"],
22        "//conditions:default": [],
23    }),
24    includes=["python_include"],
25)
26
27config_setting(
28    name="windows",
29    values={"cpu": "x64_windows"},
30    visibility=["//visibility:public"],
31)
32
33%{PYTHON_INCLUDE_GENRULE}
34%{PYTHON_IMPORT_LIB_GENRULE}
35
36
37