mirror of
https://github.com/QuixiAI/nvdriver.git
synced 2026-12-06 14:38:47 +00:00
15 lines
921 B
Bash
15 lines
921 B
Bash
#!/bin/sh
|
|
set -eu
|
|
cd "$(dirname "$0")/.."
|
|
mkdir -p target/thread-state
|
|
RUSTC=${RUSTC:-$(command -v rustc || echo "$HOME/.cargo/bin/rustc")}
|
|
"$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 -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
|