Skip to content

Commit

Permalink
Update cargo_build.py
Browse files Browse the repository at this point in the history
Detecting architecture.
  • Loading branch information
OB0NE authored Sep 8, 2024
1 parent 276d443 commit 3261db0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions build-aux/cargo_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import sys
import os
import platform

project_build_root = sys.argv[1]
project_src_root = sys.argv[2]
Expand All @@ -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}"

Expand Down

0 comments on commit 3261db0

Please sign in to comment.