diff options
author | Nathaniel Manista <nathaniel@google.com> | 2018-07-30 12:17:07 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-30 12:17:07 -0700 |
commit | a87b1fb3ef9859528f93d7792afaa121453d91c9 (patch) | |
tree | cb9e1add869b91781a1a7a1b46cfef943d7bb110 /third_party/py/BUILD.tpl | |
parent | 48d05520ac899c10cdbaffe0210adf7657d2b162 (diff) | |
parent | 11f199e34dc416a2bd8b56391b242a867bedade4 (diff) |
Merge pull request #15992 from ghostwriternr/python_bazel_1
Basic setup to build gRPC Python with Bazel.
Diffstat (limited to 'third_party/py/BUILD.tpl')
-rw-r--r-- | third_party/py/BUILD.tpl | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/third_party/py/BUILD.tpl b/third_party/py/BUILD.tpl new file mode 100644 index 0000000000..2283c573bc --- /dev/null +++ b/third_party/py/BUILD.tpl @@ -0,0 +1,36 @@ +# Adapted with modifications from tensorflow/third_party/py/ + +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"], + "//conditions:default": [], + }), + includes=["python_include"], +) + +config_setting( + name="windows", + values={"cpu": "x64_windows"}, + visibility=["//visibility:public"], +) + +%{PYTHON_INCLUDE_GENRULE} +%{PYTHON_IMPORT_LIB_GENRULE} + + |