diff options
| author | OpportunityLiu <[email protected]> | 2019-05-21 10:40:10 +0800 |
|---|---|---|
| committer | OpportunityLiu <[email protected]> | 2019-05-21 10:40:10 +0800 |
| commit | ef310a63e8b7d27cc785793b83f0f688711d5305 (patch) | |
| tree | cdea90ae7b6250a4eb5dd60190063f9c73186d8f /xmake/modules/core/tools/nvcc.lua | |
| parent | 29cd3ffaf30a04875672d2f752d1b252030e965f (diff) | |
add some comments for nvcc warning flags
Diffstat (limited to 'xmake/modules/core/tools/nvcc.lua')
| -rw-r--r-- | xmake/modules/core/tools/nvcc.lua | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/xmake/modules/core/tools/nvcc.lua b/xmake/modules/core/tools/nvcc.lua index 79a7c8019..7698b6f8f 100644 --- a/xmake/modules/core/tools/nvcc.lua +++ b/xmake/modules/core/tools/nvcc.lua @@ -81,6 +81,7 @@ function nf_warning(self, level) , error = "-Werror" } + -- for cl.exe on windows local cl_maps = { none = "-W0" @@ -91,7 +92,8 @@ function nf_warning(self, level) , everything = "-Wall" , error = "-WX" } - + + -- for gcc & clang on linux, may be work for other gnu compatible compilers such as icc local gcc_clang_maps = { none = "-w" @@ -99,15 +101,17 @@ function nf_warning(self, level) , more = "-Wall" , all = "-Wall" , extra = "-Wextra" - , everything = "-Weverything -Wall -Wextra -Weffc++" -- gcc dosen't support `-Weverything`, use `-Wall -Wextra -Weffc++` for it + -- 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" } local warning = maps[level] - -- for cl.exe + -- for cl.exe on windows, it is the only supported host compiler on the platform if is_plat("windows") then warning = warning .. ' -Xcompiler "' .. cl_maps[level] .. '"' - -- for gcc/clang + -- for gcc/clang, or any gnu compatible compiler on *nix elseif self:has_flags("-Xcompiler -Wall", "cxflags") then warning = warning .. ' -Xcompiler "' .. gcc_clang_maps[level] .. '"' end |
