Need to compile under Windows, targeting Linux

We have a moderately complex product, where we need to build various binaries targeting various operating systems. As the toolchains for some OSes (e.g. MSVS for Windows) are Windows host only, the product is built there. For our non-Windows targets, we have various cross compilers, including a GCC cross-compiler for C/C++ code targetting Linux.

We are evaluating the use of CUDA in one of the Linux targets and currently build the CUDA into a library under Linux, which is then brought back to Windows and linked in with the rest of that product (and the larger product) there. Obviously, this is not efficient so we need to investigate cross-compilation of CUDA.

Looking at this diagram:

Is it possible for us to plug in the GCC cross compiler where it is called by nvcc both at the compilation and device linking stages? The -ccbin (and possibly -allow-unsupported-compiler) options hint that this might be possible but I have two concerns:

  1. Is the C/C++ code produced by nvcc platform-specific? Would it build successfully and correctly if compiled by a cross-compiler?
  2. How can nvcc be informed that it needs to invoke the compiler using GCC options rather than MSVC options on the command line?

Thanks in advance for any help, advice or experience that you can share to help me to work around this problem.

S.