NVCC flags --compiler-options and -Xcompiler not recognised as equivalent
( As detailed at StackOverflow. )
I found that if I pass MSVC compiler options through NVCC using
-Xcompiler, these are consolidated with other
-Xcompiler options by CMake. For example, if I supply a Warning level of
/W4, this overrides any default, eg
/W3. If I supply the same option using
--compiler-options, the default is not overridden, which can lead to complaints from the underlying compiler.
--compiler-options <options>,... (-Xcompiler) Specify options directly to the compiler/preprocessor.
Tested on Windows
Microsoft (R) C/C++ Optimizing Compiler Version 19.16.27027.1 for x86 cmake version 3.15.4