Philipp Schrader | 1f0a3d0 | 2022-12-21 20:30:42 -0800 | [diff] [blame^] | 1 | load(":defs.bzl", "extract_numpy_headers") |
| 2 | |
| 3 | cc_library( |
| 4 | name = "python", |
| 5 | deps = select({ |
| 6 | "//tools/platforms/python:debian_bundled_python": [ |
| 7 | "@python_repo//:python3.9_lib", |
| 8 | ], |
| 9 | "//tools/platforms/python:upstream_bundled_python": [ |
| 10 | "@python3_9_x86_64-unknown-linux-gnu//:python_headers", |
| 11 | "@python3_9_x86_64-unknown-linux-gnu//:libpython", |
| 12 | ], |
| 13 | }), |
| 14 | defines = select({ |
| 15 | "//tools/platforms/python:debian_bundled_python": [ |
| 16 | "FRC971_DEBIAN_BUNDLED_PYTHON", |
| 17 | ], |
| 18 | "//tools/platforms/python:upstream_bundled_python": [ |
| 19 | "FRC971_UPSTREAM_BUNDLED_PYTHON", |
| 20 | "FRC971_PYTHON_HOME=../python3_9_x86_64-unknown-linux-gnu/", |
| 21 | ], |
| 22 | }), |
| 23 | visibility = ["//visibility:public"], |
| 24 | ) |
| 25 | |
| 26 | filegroup( |
| 27 | name = "python_runtime", |
| 28 | data = select({ |
| 29 | "//tools/platforms/python:debian_bundled_python": [ |
| 30 | "@python_repo//:all_files", |
| 31 | ], |
| 32 | "//tools/platforms/python:upstream_bundled_python": [ |
| 33 | "@python3_9_x86_64-unknown-linux-gnu//:files", |
| 34 | ], |
| 35 | }), |
| 36 | visibility = ["//visibility:public"], |
| 37 | ) |
| 38 | |
| 39 | extract_numpy_headers( |
| 40 | name = "numpy_headers", |
| 41 | numpy = "@pip//numpy", |
| 42 | header_prefix = "numpy_headers", |
| 43 | visibility = ["//visibility:private"], |
| 44 | ) |
| 45 | |
| 46 | cc_library( |
| 47 | name = "numpy_cc", |
| 48 | hdrs = [ |
| 49 | ":numpy_headers", |
| 50 | ], |
| 51 | includes = [ |
| 52 | "numpy_headers", |
| 53 | ], |
| 54 | deps = [ |
| 55 | ":python", |
| 56 | ], |
| 57 | visibility = ["//visibility:public"], |
| 58 | ) |