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", |
Philipp Schrader | 01535ee | 2023-01-08 13:19:03 -0800 | [diff] [blame^] | 5 | deps = [ |
| 6 | "@python3_9_x86_64-unknown-linux-gnu//:python_headers", |
| 7 | "@python3_9_x86_64-unknown-linux-gnu//:libpython", |
| 8 | ], |
| 9 | defines = [ |
| 10 | "FRC971_UPSTREAM_BUNDLED_PYTHON", |
| 11 | "FRC971_PYTHON_HOME=../python3_9_x86_64-unknown-linux-gnu/", |
| 12 | ], |
| 13 | target_compatible_with = [ |
| 14 | "@platforms//cpu:x86_64", |
| 15 | "@platforms//os:linux", |
| 16 | ], |
Philipp Schrader | 1f0a3d0 | 2022-12-21 20:30:42 -0800 | [diff] [blame] | 17 | visibility = ["//visibility:public"], |
| 18 | ) |
| 19 | |
| 20 | filegroup( |
| 21 | name = "python_runtime", |
Philipp Schrader | 01535ee | 2023-01-08 13:19:03 -0800 | [diff] [blame^] | 22 | data = [ |
| 23 | "@python3_9_x86_64-unknown-linux-gnu//:files", |
| 24 | ], |
| 25 | target_compatible_with = [ |
| 26 | "@platforms//cpu:x86_64", |
| 27 | "@platforms//os:linux", |
| 28 | ], |
Philipp Schrader | 1f0a3d0 | 2022-12-21 20:30:42 -0800 | [diff] [blame] | 29 | visibility = ["//visibility:public"], |
| 30 | ) |
| 31 | |
| 32 | extract_numpy_headers( |
| 33 | name = "numpy_headers", |
| 34 | numpy = "@pip//numpy", |
| 35 | header_prefix = "numpy_headers", |
| 36 | visibility = ["//visibility:private"], |
| 37 | ) |
| 38 | |
| 39 | cc_library( |
| 40 | name = "numpy_cc", |
| 41 | hdrs = [ |
| 42 | ":numpy_headers", |
| 43 | ], |
| 44 | includes = [ |
| 45 | "numpy_headers", |
| 46 | ], |
| 47 | deps = [ |
| 48 | ":python", |
| 49 | ], |
| 50 | visibility = ["//visibility:public"], |
| 51 | ) |