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.76k stars 425 forks source link

[Feature Request] Remove `-ccbin` flag on demand #1084

Closed QuarticCat closed 1 month ago

QuarticCat commented 1 month ago

On Arch Linux, without the -ccbin flag, nvcc will choose g++-13 by default. However, cc generates -ccbin=c++ which links to GCC 14, causing compile errors. Although on my own machine, I can specify the CXX environment variable, I can't simply fix the version for lib users. The best way to fix this problem is to remove the -ccbin flag and let nvcc decide host compiler by itself.

NobodyXu commented 1 month ago

Having a new function for this does sound reasonable.

I will accept a PR for this new function.

QuarticCat commented 1 month ago

Thx. I'll have a try.