File: test_cross_build.sh

package info (click to toggle)
rust-netlink-packet-route-0.19 0.19.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,544 kB
  • sloc: sh: 12; makefile: 2
file content (19 lines) | stat: -rwxr-xr-x 521 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash -ex
# SPDX-License-Identifier: MIT

EXEC_PATH=$(dirname "$(realpath "$0")")
PROJECT_PATH="$(dirname $EXEC_PATH)"

CI_CONFIG_FOR_BUILD="$PROJECT_PATH/.github/workflows/build.yml"
BUILD_TARGETS=$(sed -ne 's/^.*rust_target: "\(.*\)"/\1/p' $CI_CONFIG_FOR_BUILD)

cd $PROJECT_PATH

for BUILD_TARGET in $BUILD_TARGETS;do
    if [ "CHK$(rustup target list --installed \
               | grep $BUILD_TARGET)" == "CHK" ];then
        rustup target add $BUILD_TARGET
    fi

    cargo build --target $BUILD_TARGET
done