(context, host=None)
| 271 | |
| 272 | |
| 273 | def make_host_python(context, host=None): |
| 274 | if host is None: |
| 275 | host = context.host |
| 276 | # The CFLAGS and LDFLAGS set in android-env include the prefix dir, so |
| 277 | # delete any previous Python installation to prevent it being used during |
| 278 | # the build. |
| 279 | host_dir = subdir(host) |
| 280 | prefix_dir = host_dir / "prefix" |
| 281 | for pattern in ("include/python*", "lib/libpython*", "lib/python*"): |
| 282 | delete_glob(f"{prefix_dir}/{pattern}") |
| 283 | |
| 284 | # The Android environment variables were already captured in the Makefile by |
| 285 | # `configure`, and passing them again when running `make` may cause some |
| 286 | # flags to be duplicated. So we don't use the `host` argument here. |
| 287 | os.chdir(host_dir) |
| 288 | run(["make", "-j", str(os.cpu_count())]) |
| 289 | |
| 290 | # The `make install` output is very verbose and rarely useful, so |
| 291 | # suppress it by default. |
| 292 | run( |
| 293 | ["make", "install", f"prefix={prefix_dir}"], |
| 294 | capture_output=not context.verbose, |
| 295 | ) |
| 296 | |
| 297 | |
| 298 | def build_targets(context): |
no test coverage detected
searching dependent graphs…