NVCC overriding a MSVC flag (EHs)

懵懂的女人 提交于 2021-02-11 15:17:30

问题


To compile my source correctly on Windows, I need to pass the EHs flag to MSVC. This is usually straight forward:

cl -EHs -c ...

When building for GPU acceleration, I need nvcc to pass this flag along when it invokes cl under the hood. I simply do:

nvcc -dc -ccbin cl -Xcompiler -EHs ...

yet cl throws a warning:

warning C4297: 'someFuncInMyCode': function assumed not to throw an exception but does
note: The function is extern "C" and /EHc was specified

It seems cl receives the flag EHc, instead of EHs, igoring my flag passed through -Xcompiler. There is no warning from MSVC that my EHs argument was overridden.

How can I prevent nvcc from passing EHc (if that's indeed happening), otherwise is there a mistake in my forwarding of cl flags?

来源:https://stackoverflow.com/questions/61175954/nvcc-overriding-a-msvc-flag-ehs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!