NVCC fatal error If compiler warnings are set on Cuda 10.2

I have just setup CUDA 10.2 on Ubuntu 18.04.
I am using CMake to generate manage my code, and when I try to compile my code with any Compiler warnings I get the following errors depending on which warning has been activated.

nvcc fatal : Value ‘-Wmisleading-indentation’ is not defined for option ‘Werror’
nvcc fatal : Value ‘-Wduplicated-cond’ is not defined for option ‘Werror’
nvcc fatal : Value ‘-x’ is not defined for option ‘Werror’

if i remove all compiler warnings the program compiles successfully.
Does anybody know why this is the case, or how i can debug, or solve the problem.
Im fairly new to CUDA and this is my first serious attempt at using the language.

Any help would be greatly appreciated

Hi @arifsaeed78

To enable the compiler warnings, you need to may use the nvcc flag: --compiler-options. In the case of your flags:

--compiler-options -Werror 

This is because those warning flags are compiler flags.

Regards,
Leon.