MCPcopy Index your code
hub / github.com/python/cpython / make_host_python

Function make_host_python

Android/android.py:273–295  ·  view source on GitHub ↗
(context, host=None)

Source from the content-addressed store, hash-verified

271
272
273def 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
298def build_targets(context):

Callers 1

build_targetsFunction · 0.70

Calls 5

delete_globFunction · 0.85
strFunction · 0.85
cpu_countMethod · 0.80
subdirFunction · 0.70
runFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…