Visual Studio(2015), Build Customization, and multiple platforms.

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
#ifndef DISABLE_GPU
// cuda related code
#endif

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.

you can name all your files .cpp and use -x cu when you compile the ones that have device code in them. You can then use your conditional compilation ifndef to enable the file to be processed by your host compiler.