summaryrefslogtreecommitdiff
path: root/xmake/modules/core/tools/nvcc.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2019-05-21 00:43:27 +0800
committerruki <[email protected]>2019-05-20 22:20:44 +0800
commit7ed7da5e9b333930081b50ff3781ea0a07417a1b (patch)
treedd344b3c8e7092b808e3de3357f0a60bffc69344 /xmake/modules/core/tools/nvcc.lua
parentdfa26e72bc4d830c0ace72bdfba51142f1348bef (diff)
improve nf_wanring for nvcc
Diffstat (limited to 'xmake/modules/core/tools/nvcc.lua')
-rw-r--r--xmake/modules/core/tools/nvcc.lua29
1 files changed, 21 insertions, 8 deletions
diff --git a/xmake/modules/core/tools/nvcc.lua b/xmake/modules/core/tools/nvcc.lua
index b14ec8829..543d5d5a4 100644
--- a/xmake/modules/core/tools/nvcc.lua
+++ b/xmake/modules/core/tools/nvcc.lua
@@ -71,15 +71,28 @@ function nf_warning(self, level)
-- the maps
local maps =
{
- none = "-w"
- , less = "-W1"
- , more = "-W3"
- , all = "-Wall"
- , error = "-Werror"
+ none = "-w"
+ , extra = "-Wreorder"
+ , everything = "-Wreorder"
+ , error = "-Werror"
}
-
- -- make it
- return maps[level]
+
+ local warning = maps[level]
+ if not warning then
+ -- for cl.exe
+ if is_plat("windows") then
+ maps.less = "-Xcompiler -W1"
+ maps.more = "-Xcompiler -W3"
+ maps.all = "-Xcompiler -W3"
+ -- for gcc/clang
+ elseif self:has_flags("-Xcompiler -Wall", "cxflags") then
+ maps.less = "-Xcompiler -Wall"
+ maps.more = "-Xcompiler -Wall"
+ maps.all = "-Xcompiler -Wall"
+ end
+ warning = maps[level]
+ end
+ return warning
end
-- make the optimize flag