aboutsummaryrefslogtreecommitdiffhomepage
path: root/third_party/py/BUILD.tpl
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/py/BUILD.tpl')
-rw-r--r--third_party/py/BUILD.tpl22
1 files changed, 8 insertions, 14 deletions
diff --git a/third_party/py/BUILD.tpl b/third_party/py/BUILD.tpl
index 1dd8ab433a..de06ad5f27 100644
--- a/third_party/py/BUILD.tpl
+++ b/third_party/py/BUILD.tpl
@@ -2,26 +2,20 @@ licenses(["restricted"])
package(default_visibility = ["//visibility:public"])
-# To build Python C/C++ extension on Windows, we need to link to python import library pythonXY.lib
-# See https://docs.python.org/3/extending/windows.html
-cc_import(
- name = "python_lib",
- interface_library = select({
- ":windows": ":python_import_lib",
- # A placeholder for Unix platforms which makes --no_build happy.
- "//conditions:default": "not-existing.lib",
- }),
- system_provided = 1,
-)
-
cc_library(
name = "python_headers",
hdrs = [":python_include"],
- deps = select({
- ":windows": [":python_lib"],
+ data = select({
+ ":windows": [":python_import_lib"],
"//conditions:default": [],
}),
includes = ["python_include"],
+ linkopts = select({
+ # TODO(pcloudy): Ideally, this should just go into deps after resolving
+ # https://github.com/bazelbuild/bazel/issues/3237,
+ ":windows": ["$(locations :python_import_lib)"],
+ "//conditions:default": [],
+ }),
)
cc_library(