From bf8cda088d12307ba552456c6ea4f77fd84f3645 Mon Sep 17 00:00:00 2001 From: "Thing-han, Lim" <15379156+potsrevennil@users.noreply.github.com> Date: Tue, 23 Jul 2024 11:31:41 +0800 Subject: [PATCH] set default of cross prefix for different machines to make it clearer Signed-off-by: Thing-han, Lim <15379156+potsrevennil@users.noreply.github.com> --- scripts/tests | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/scripts/tests b/scripts/tests index 068c9e138..959eba0cf 100755 --- a/scripts/tests +++ b/scripts/tests @@ -40,20 +40,14 @@ def base_compile( s += f"{k}={v} " return s - if platform.machine() == "x86_64": - logging.debug(f"Cross compiling {bin}") + logging.debug(f"Compiling {bin}...") + args = [ + "make", + f"CROSS_PREFIX={cross_prefix}", + f"{bin}", + ] + extra_make_args - args = [ - "make", - f"CROSS_PREFIX={cross_prefix}", - f"{bin}", - ] + extra_make_args - - else: - logging.debug(f"Compiling {bin} natively") - - args = ["make", f"{bin}"] + extra_make_args - logging.info(dict2str(extra_make_envs) + " ".join(args)) + logging.info(dict2str(extra_make_envs) + " ".join(args)) p = subprocess.run( args, @@ -244,8 +238,8 @@ _shared_options = [ click.option( "-cp", "--cross-prefix", + default="aarch64-unknown-linux-gnu-" if platform.machine() == "x86_64" else " ", show_default=True, - default="aarch64-unknown-linux-gnu-", hidden=platform.machine() != "x86_64", nargs=1, help="Cross prefix for compilation on non-aarch64 machines",