NVCC passes /Wall to MSVC without me having told it to
/Wall
is not a useful flag to pass to MSVC. It gives you tons of compiler behavior notifications, like which functions are selected for inlining where, which functions are removed because they are unused etc.
However, it seems that CMake configures MS-Windows builds, in some situations (or even by default?) to pass this option to MSVC. . Example repository where this occurs: cuda-api-wrappers; example command-line:
C:\Users\User\src\cuda-api-wrappers\build\examples>"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.5\bin\nvcc.exe" -gencode=arch=compute_52,code=\"sm_5 2,compute_52\" --use-local-env -ccbin "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\HostX64\x64" -x cu -I"C:\U sers\User\src\cuda-api-wrappers\src" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.5\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA \v11.5\include" --keep-dir x64\Release -maxrregcount=0 --machine 64 --compile -cudart static -Xcompiler="/EHsc -Ob2" -D_WINDOWS -DNDEBUG -D"CMAKE_INTDI R=\"Release\"" -D"CMAKE_INTDIR=\"Release\"" -D_MBCS -Xcompiler "/EHsc /Wall /nologo /O2 /FdvectorAddManaged.dir\Release\vc142.pdb /FS /MD /GR" -o vectorAddMa naged.dir\Release\vectorAddManaged.obj "C:\Users\User\src\cuda-api-wrappers\examples\modified_cuda_samples\vectorAddManaged\vectorAddManaged.cu"
Seeing this with CMake version 3.20.21032501-MSVC_2 (bundled by MS).
Either a lower /Wn
option be passed, or none at all. /Wall
is not an option. (!)