I don’t know why nobody else has run into this yet, but I have multiple platforms/OS’s I build for using visual studio. I have GPU builds of my project and CPU only builds. I have no physical way to tell NVCC to disable on certain build configurations. The only thing I can do is
// cuda related code
But cuda compiler will still build .cu. Even if I take all the cuda related items and cpps associated and move to another seperate project that I untick to build on cpu builds I still have the final exe which is shared between builds to do CPU or GPU which means I have to have build customizations for cuda linker to work.
We need to be able to to set in cuda linker/compiler options to disable it entirely for certain configurations. If disabled it can just ignore .cu files and do nothing.