xmake icon indicating copy to clipboard operation
xmake copied to clipboard

set_warnings 隔离 nvcc 和 cxx

Open TOMO-CAT opened this issue 7 months ago • 15 comments

你在什么场景下需要该功能?

目前 set_warnings 会对所有 nvcc 和 clang 生效,假设我设置:

set_warnings("all", "extra", "error")

nvcc 编译会直接带上 -Werror cross-execution-space-call,reorder,deprecated-declarations ,按照 nvcc 官网的描述和 clang 区别不大:

https://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/#command-option-description image

问题在于 clang 可以通过 -Wno 关闭一些 werror,但是 nvcc 即使带上 supress 也无法屏蔽 error,所以 set_warnings 对我们而言杀伤力太大,希望可以分离: image image image

描述可能的解决方案

目前 add_cxxflags 和 add_cuflags 分别控制 warning,但是和 set_warnings 可能存在参数顺序的问题导致不生效

描述你认为的候选方案

No response

其他信息

No response

TOMO-CAT avatar Jul 23 '24 03:07 TOMO-CAT