| 1 |
package(default_visibility=["//visibility:public"]) |
| 2 |
|
| 3 |
# To build Python C/C++ extension on Windows, we need to link to python import library pythonXY.lib |
| 4 |
# See https://docs.python.org/3/extending/windows.html |
| 5 |
cc_import( |
| 6 |
name="%{VARIETY_NAME}_lib", |
| 7 |
interface_library=select({ |
| 8 |
"//:windows": ":%{VARIETY_NAME}_import_lib", |
| 9 |
# A placeholder for Unix platforms which makes --no_build happy. |
| 10 |
"//conditions:default": "not-existing.lib", |
| 11 |
}), |
| 12 |
system_provided=1, |
| 13 |
) |
| 14 |
|
| 15 |
cc_library( |
| 16 |
name="%{VARIETY_NAME}_headers", |
| 17 |
hdrs=[":%{VARIETY_NAME}_include"], |
| 18 |
deps=select({ |
| 19 |
"//:windows": [":%{VARIETY_NAME}_lib"], |
| 20 |
"//conditions:default": [], |
| 21 |
}), |
| 22 |
includes=["%{VARIETY_NAME}_include"], |
| 23 |
) |
| 24 |
|
| 25 |
%{PYTHON_INCLUDE_GENRULE} |
| 26 |
%{PYTHON_IMPORT_LIB_GENRULE} |