mirror of
https://github.com/QuixiAI/nvdriver.git
synced 2026-12-06 06:28:39 +00:00
23 lines
1.1 KiB
Bash
23 lines
1.1 KiB
Bash
#!/bin/sh
|
|
set -eu
|
|
cd "$(dirname "$0")/.."
|
|
mkdir -p target/thread-state
|
|
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
|
|
"$RUSTC" --edition=2024 --crate-name nv_rs_abi --crate-type=rlib src/common/abi/src/lib.rs -o target/thread-state/libnv_rs_abi.rlib
|
|
"$RUSTC" --edition=2024 --crate-name nv_rs_core --crate-type=rlib src/nvidia/src/lib.rs --extern nv_rs_abi=target/thread-state/libnv_rs_abi.rlib -o target/thread-state/libnv_rs_core.rlib
|
|
cc -fPIC -std=c11 -Wall -Wextra -Werror -pthread -c tests/thread-state/ffi.c -o target/thread-state/ffi.o
|
|
"$RUSTC" --edition=2024 --test tests/thread-state/fixture.rs \
|
|
--extern nv_rs_core=target/thread-state/libnv_rs_core.rlib \
|
|
--extern nv_rs_abi=target/thread-state/libnv_rs_abi.rlib \
|
|
-L dependency=target/thread-state -C link-arg=target/thread-state/ffi.o -C link-arg=-pthread \
|
|
-o target/thread-state/fixture
|
|
target/thread-state/fixture --test-threads=1
|