diff options
| author | OpportunityLiu <[email protected]> | 2019-05-21 09:47:51 +0800 |
|---|---|---|
| committer | OpportunityLiu <[email protected]> | 2019-05-21 09:54:01 +0800 |
| commit | b9a9de043eccb54e6be4cf8a0108f96d856f2b43 (patch) | |
| tree | 3638e595e9acb54c09deb776975ca72f3de202f2 /xmake/modules/core/tools/nvcc.lua | |
| parent | a4dfd8fd27eed47d760c78db4672fd50d0f2fbac (diff) | |
add more support
Diffstat (limited to 'xmake/modules/core/tools/nvcc.lua')
| -rw-r--r-- | xmake/modules/core/tools/nvcc.lua | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/xmake/modules/core/tools/nvcc.lua b/xmake/modules/core/tools/nvcc.lua index 4048929b8..543d5d5a4 100644 --- a/xmake/modules/core/tools/nvcc.lua +++ b/xmake/modules/core/tools/nvcc.lua @@ -20,7 +20,6 @@ -- imports import("core.base.option") -import("core.tool.compiler") import("core.project.config") import("core.project.project") import("core.language.language") @@ -73,25 +72,27 @@ function nf_warning(self, level) local maps = { none = "-w" - , less = "" - , more = "" - , all = "" , extra = "-Wreorder" , everything = "-Wreorder" , error = "-Werror" } - - local cu_cxx = config.get("cu-cxx") - local cu_cxx_tool = nil - 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) + + 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 - - 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 ..'"' + return warning end -- make the optimize flag |
