Skip cargo build if possible

This commit is contained in:
topjohnwu 2023-08-30 16:23:27 -07:00
parent 4c45775131
commit 96e559fb0e
1 changed files with 5 additions and 3 deletions

View File

@ -259,7 +259,6 @@ def run_cargo(cmds, triple="aarch64-linux-android"):
def run_cargo_build(args):
os.chdir(op.join("native", "src"))
native_out = op.join("..", "out")
mkdir(native_out)
@ -267,6 +266,9 @@ def run_cargo_build(args):
if "resetprop" in args.target:
targets.add("magisk")
if len(targets) == 0:
return
# Start building the actual build commands
cmds = ["build"]
for target in targets:
@ -298,8 +300,6 @@ def run_cargo_build(args):
target = op.join(arch_out, f"lib{tgt}-rs.a")
mv(source, target)
os.chdir(op.join("..", ".."))
def run_cargo_cmd(args):
global STDOUT
@ -382,7 +382,9 @@ def build_binary(args):
header("* Building binaries: " + " ".join(args.target))
os.chdir(op.join("native", "src"))
run_cargo_build(args)
os.chdir(op.join("..", ".."))
dump_flag_header()