summaryrefslogtreecommitdiff
path: root/xmake/modules/core/tools/nvcc.lua
diff options
context:
space:
mode:
authorOpportunityLiu <[email protected]>2019-05-20 19:41:34 +0800
committerOpportunityLiu <[email protected]>2019-05-21 09:53:44 +0800
commit5a9914c5de7ee2ef65e3011c9e6ff73714de51e6 (patch)
treea5b1ead0bfb0d354a73c89ff2055f0a67e77034a /xmake/modules/core/tools/nvcc.lua
parentfc17d122cbfadf4af3aac274e4481c3ecf72e816 (diff)
tool
Diffstat (limited to 'xmake/modules/core/tools/nvcc.lua')
-rw-r--r--xmake/modules/core/tools/nvcc.lua28
1 files changed, 12 insertions, 16 deletions
diff --git a/xmake/modules/core/tools/nvcc.lua b/xmake/modules/core/tools/nvcc.lua
index 543d5d5a4..b282ab8ce 100644
--- a/xmake/modules/core/tools/nvcc.lua
+++ b/xmake/modules/core/tools/nvcc.lua
@@ -20,6 +20,7 @@
-- imports
import("core.base.option")
+import("core.tool.tool")
import("core.project.config")
import("core.project.project")
import("core.language.language")
@@ -76,23 +77,18 @@ function nf_warning(self, level)
, everything = "-Wreorder"
, error = "-Werror"
}
-
- 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]
+
+ local cu_cxx = config.get("cu-cxx")
+ local cu_cxx_tool = nil tool.load("cxx")
+ if is_plat("windows") or not cu_cxx then
+ cu_cxx_tool = tool.load("cxx")
+ elseif cu_cxx then
+ cu_cxx_tool = tool.load("cxx", cu_cxx)
end
- return warning
+
+ local cu_cxx_tool_warning = cu_cxx_tool.nf_warning(level)
+ -- make it
+ return maps[level] .. ' -Xcompiler "' .. cu_cxx_tool_warning .. '" -Xlinker "' .. cu_cxx_tool_warning ..'"'
end
-- make the optimize flag