Skip to content

Commit a75fc66

Browse files
committed
Fix: include CUDA when building optix_sys
1 parent 7d88445 commit a75fc66

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

crates/optix_sys/build.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use find_cuda_helper::find_optix_root;
1+
use find_cuda_helper::{find_cuda_root, find_optix_root};
22
use std::env;
33

44
// OptiX is a bit exotic in how it provides its functions. It uses a function table
@@ -13,9 +13,16 @@ fn main() {
1313
that OPTIX_ROOT or OPTIX_ROOT_DIR are set",
1414
);
1515
header = header.join("include");
16+
let cuda_dir = find_cuda_root()
17+
.expect(
18+
"Unable to find the CUDA SDK, make sure you
19+
installed it and that CUDA_ROOT is set",
20+
)
21+
.join("include");
1622

1723
cc::Build::new()
1824
.file("./optix_stubs.c")
25+
.include(cuda_dir)
1926
.include(header)
2027
.cpp(false)
2128
.compile("optix_stubs");

0 commit comments

Comments
 (0)