rust-lang / cc-rs

Rust library for build scripts to compile C/C++ code into a Rust library
https://docs.rs/cc
Apache License 2.0
1.81k stars 434 forks source link

feature request: Allow setting nvcc executable via env var. #995

Open MarcusDunn opened 6 months ago

MarcusDunn commented 6 months ago

The env vars CC and CXX can be set to point to C and c++ compilers respectively, I'd like to be able to set the nvcc executable in a similar way.

CMake uses CUDACXX, which seems reasonable enough and would work for my usecase. I currently just modify PATH.

Somthing analogous to CFLAGS and CXXFLAGS for Cuda would also be nice for completions sake, but I have not found a need for it.

I could probably implement and document this myself if this feature is in scope for the project.

NobodyXu commented 6 months ago

I will accept a PR to add this, the env is documented in src/lib.rs