summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpportunityLiu <[email protected]>2019-05-21 18:15:21 +0800
committerOpportunityLiu <[email protected]>2019-05-21 18:15:21 +0800
commit9921a973ef37a89394f9a96366cd29eb70b6ba02 (patch)
tree3ffe823885c4eed1e181f437b932a2636fe8c54a
parent339b0a09220f367c76efbd70603014d8b05ccf00 (diff)
simplify
-rw-r--r--xmake/modules/core/tools/nvcc.lua9
1 files changed, 4 insertions, 5 deletions
diff --git a/xmake/modules/core/tools/nvcc.lua b/xmake/modules/core/tools/nvcc.lua
index 5993e9bb8..b284313a7 100644
--- a/xmake/modules/core/tools/nvcc.lua
+++ b/xmake/modules/core/tools/nvcc.lua
@@ -106,7 +106,7 @@ function nf_warning(self, level)
, everything = "-Weverything -Wall -Wextra -Weffc++"
, error = "-Werror"
}
-
+
local warning = maps[level]
local host_warning = nil
@@ -118,12 +118,11 @@ function nf_warning(self, level)
host_warning = gcc_clang_maps[level]
end
- if warning and host_warning then
- warning = warning .. ' -Xcompiler "' .. host_warning .. '"'
- elseif host_warning then
- warning = '-Xcompiler "' .. host_warning .. '"'
+ if host_warning then
+ warning = ((warning or "") .. ' -Xcompiler "' .. host_warning .. '"'):trim()
end
return warning
+
end
-- make the optimize flag