From 3261db0b783363e177b4f2ef55df87a41554fe38 Mon Sep 17 00:00:00 2001 From: OB0NE <144986313+OB0NE@users.noreply.github.com> Date: Mon, 9 Sep 2024 02:05:07 +0800 Subject: [PATCH] Update cargo_build.py Detecting architecture. --- build-aux/cargo_build.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/build-aux/cargo_build.py b/build-aux/cargo_build.py index 5fca7ef271..10e54c1c13 100644 --- a/build-aux/cargo_build.py +++ b/build-aux/cargo_build.py @@ -2,6 +2,7 @@ import sys import os +import platform project_build_root = sys.argv[1] project_src_root = sys.argv[2] @@ -22,6 +23,15 @@ output_file: {output_file} """, file=sys.stderr) +# Detecting architecture +if sys.platform == 'win32': + if platform.machine().lower() == 'arm64': + rustflags = '-C linker=clang' + else: + rustflags = '' +else: + rustflags = '' + cargo_call = f"env {cargo_env} {cargo_cmd} build {cargo_options}" cp_call = f"cp {bin_output} {output_file}"