mirror of
https://github.com/QuixiAI/nvdriver.git
synced 2026-12-06 22:48:43 +00:00
22 lines
1.3 KiB
Bash
Executable File
22 lines
1.3 KiB
Bash
Executable File
#!/bin/sh
|
|
set -eu
|
|
TASK_ROOT=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
|
|
cd "$TASK_ROOT"
|
|
TASK_OUT="$TASK_ROOT/target/software-manager"
|
|
mkdir -p "$TASK_OUT"
|
|
if [ -z "${RUSTC:-}" ]; then
|
|
if RUSTC=$(command -v rustc 2>/dev/null); then
|
|
:
|
|
elif [ -n "${CARGO_HOME:-}" ] && [ -x "$CARGO_HOME/bin/rustc" ]; then
|
|
RUSTC="$CARGO_HOME/bin/rustc"
|
|
else
|
|
RUSTC="$HOME/.cargo/bin/rustc"
|
|
fi
|
|
fi
|
|
cc -std=c11 -Wall -Wextra -Werror -pthread -Itests/software-manager -c tests/software-manager/fixture.c -o "$TASK_OUT/adapter.o"
|
|
cc -std=c11 -D_GNU_SOURCE -Wall -Wextra -Werror -c tests/pf-software/registry.c -o "$TASK_OUT/registry.o"
|
|
"$RUSTC" --edition=2024 --crate-name nv_rs_abi --crate-type=rlib src/common/abi/src/lib.rs -o "$TASK_OUT/libnv_rs_abi.rlib"
|
|
"$RUSTC" --edition=2024 --crate-name nv_rs_core --crate-type=rlib src/nvidia/src/lib.rs --extern nv_rs_abi="$TASK_OUT/libnv_rs_abi.rlib" -o "$TASK_OUT/libnv_rs_core.rlib"
|
|
"$RUSTC" --edition=2024 --test --crate-name nv_software_manager tests/software-manager/owned.rs --extern nv_rs_abi="$TASK_OUT/libnv_rs_abi.rlib" --extern nv_rs_core="$TASK_OUT/libnv_rs_core.rlib" -L dependency="$TASK_OUT" -C link-arg="$TASK_OUT/adapter.o" -C link-arg="$TASK_OUT/registry.o" -C link-arg=-lpthread -o "$TASK_OUT/fixture"
|
|
"$TASK_OUT/fixture"
|