summaryrefslogtreecommitdiffhomepage
path: root/scripts/utils/host
blob: 28301e636dd1bee05c5119982096022994067d36 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env bash
# shellcheck shell=bash

# This function returns the target triple of the machine running this script

case "$(uname -s)" in
  Linux*)
    arch="$(uname -m)"
    HOST="${arch}-unknown-linux-gnu"
    ;;
  Darwin*)
    arch="$(uname -m)"
    if [[ ("${arch}" == "arm64") ]]; then
        arch="aarch64"
    fi
    HOST="${arch}-apple-darwin"
    ;;
  MINGW*|MSYS_NT*)
    HOST="x86_64-pc-windows-msvc"
    ;;
esac