diff options
| author | ruki <[email protected]> | 2019-05-22 00:29:00 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2019-05-21 20:54:03 +0800 |
| commit | a3c9277b29176637c74c5feb3a7018e5c75a6d38 (patch) | |
| tree | c5f40e14dd6204997faa5fda20e870b07c7cc89b | |
| parent | b543bb4cb820298246d79277722d8ecd94ee3a17 (diff) | |
improve nvcc/warning
| -rw-r--r-- | xmake/modules/core/tools/nvcc.lua | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/xmake/modules/core/tools/nvcc.lua b/xmake/modules/core/tools/nvcc.lua index b830e2c65..1032c4cbf 100644 --- a/xmake/modules/core/tools/nvcc.lua +++ b/xmake/modules/core/tools/nvcc.lua @@ -72,9 +72,6 @@ function nf_warning(self, level) local maps = { none = "-w" - , less = nil - , more = nil - , all = nil , extra = "-Wreorder" , everything = "-Wreorder" , error = "-Werror" @@ -93,6 +90,10 @@ function nf_warning(self, level) } -- for gcc & clang on linux, may be work for other gnu compatible compilers such as icc + -- + -- gcc dosen't support `-Weverything`, use `-Wall -Wextra -Weffc++` for it + -- no warning will emit for unsupoorted `-W` flags by clang/gcc + -- local gcc_clang_maps = { none = "-w" @@ -100,23 +101,24 @@ function nf_warning(self, level) , more = "-Wall" , all = "-Wall" , extra = "-Wextra" - -- gcc dosen't support `-Weverything`, use `-Wall -Wextra -Weffc++` for it - -- no warning will emit for unsupoorted `-W` flags by clang/gcc , everything = "-Weverything -Wall -Wextra -Weffc++" , error = "-Werror" } + -- get warning for nvcc local warning = maps[level] - local host_warning = nil + -- add host warning + -- -- for cl.exe on windows, it is the only supported host compiler on the platform + -- for gcc/clang, or any gnu compatible compiler on *nix + -- + local host_warning = nil if is_plat("windows") then host_warning = cl_maps[level] - -- for gcc/clang, or any gnu compatible compiler on *nix else host_warning = gcc_clang_maps[level] end - if host_warning then warning = ((warning or "") .. ' -Xcompiler "' .. host_warning .. '"'):trim() end |
