From 1671667d3121d9876398581e771cb3182e8b3683 Mon Sep 17 00:00:00 2001 From: Opportunity Date: Tue, 9 Jan 2024 13:37:02 +0800 Subject: fix: nvcc error flags, close #4574 --- xmake/modules/core/tools/nvcc.lua | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/xmake/modules/core/tools/nvcc.lua b/xmake/modules/core/tools/nvcc.lua index 7050f86af..42d826be4 100644 --- a/xmake/modules/core/tools/nvcc.lua +++ b/xmake/modules/core/tools/nvcc.lua @@ -46,9 +46,9 @@ function init(self) self:set("mapflags", { -- warnings - ["-W4"] = "-Wreorder" - , ["-Wextra"] = "-Wreorder" - , ["-Weverything"] = "-Wreorder" + ["-W4"] = "-Wreorder --Wno-deprecated-gpu-targets --Wno-deprecated-declarations" + , ["-Wextra"] = "-Wreorder --Wno-deprecated-gpu-targets --Wno-deprecated-declarations" + , ["-Weverything"] = "-Wreorder --Wno-deprecated-gpu-targets --Wno-deprecated-declarations" }) end @@ -58,7 +58,7 @@ function nf_symbol(self, level, opt) -- debug? generate *.pdb file local flags = nil if level == "debug" then - flags = {"-G", "-g", "-lineinfo"} + flags = {"-g", "-lineinfo"} if self:is_plat("windows") then local host_flags = nil local symbolfile = nil @@ -96,8 +96,8 @@ function nf_warning(self, level) local maps = { none = "-w" - , everything = "-Wreorder" - , error = "-Werror" + , everything = { "-Wreorder", "--Wno-deprecated-gpu-targets", "--Wno-deprecated-declarations" } + , error = { "-Werror", "cross-execution-space-call,reorder,deprecated-declarations" } } -- for cl.exe on windows @@ -143,7 +143,9 @@ function nf_warning(self, level) host_warning = gcc_clang_maps[level] end if host_warning then - warning = ((warning or "") .. ' -Xcompiler "' .. host_warning .. '"'):trim() + warning = table.wrap(warning) + table.insert(warning, '-Xcompiler') + table.insert(warning, host_warning) end return warning -- cgit v1.3.1