diff options
| author | ruki <[email protected]> | 2017-10-08 21:44:11 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2017-10-08 21:44:11 +0800 |
| commit | 6a282c696b0d14b894b19c3c6df9f1431c70ea51 (patch) | |
| tree | b3ef760780bc561a1b1233da677d687602bfe6bf | |
| parent | acba01c9e2984195657831609593149969bbf03e (diff) | |
add -w and --warning args
| -rw-r--r-- | CHANGELOG.md | 2 | ||||
| -rw-r--r-- | xmake/actions/build/xmake.lua | 1 | ||||
| -rw-r--r-- | xmake/modules/core/tools/gcc.lua | 2 |
3 files changed, 4 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e79493aa..ddc535498 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ * Update project templates with tbox * Improve `lib.detect.find_program` interface * Enable colors output for windows cmd +* Add `-w|--warning` arguments to enable the warnings output ### Bugs fixed @@ -387,6 +388,7 @@ * 更新tbox工程模板 * 改进`lib.detect.find_program`模块接口 * 为windows cmd终端增加彩色输出 +* 增加`-w|--warning`参数来启用实时警告输出 ### Bugs修复 diff --git a/xmake/actions/build/xmake.lua b/xmake/actions/build/xmake.lua index 81174c469..7d8e2442a 100644 --- a/xmake/actions/build/xmake.lua +++ b/xmake/actions/build/xmake.lua @@ -48,6 +48,7 @@ task("build") , {} , {'j', "jobs", "kv", "4", "Specifies the number of jobs to build simultaneously." } + , {'w', "warning", "k", false, "Enable the warnings output." } , {} , {nil, "target", "v", nil, "Build the given target." } diff --git a/xmake/modules/core/tools/gcc.lua b/xmake/modules/core/tools/gcc.lua index 007ce26bb..91ee95eb6 100644 --- a/xmake/modules/core/tools/gcc.lua +++ b/xmake/modules/core/tools/gcc.lua @@ -447,7 +447,7 @@ function _compile1(self, sourcefile, objectfile, depinfo, flags) function (ok, warnings) -- print some warnings - if warnings and #warnings > 0 and option.get("verbose") then + if warnings and #warnings > 0 and (option.get("verbose") or option.get("warning")) then cprint("${yellow}%s", table.concat(table.slice(warnings:split('\n'), 1, 8), '\n')) end end |
