summaryrefslogtreecommitdiff
path: root/xmake/modules/core/tools/gcc.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2020-10-28 22:42:47 +0800
committerruki <[email protected]>2020-10-28 22:42:47 +0800
commit2aa699bb2c0e7e031ea7cfe98b0e60ff9eae073b (patch)
treebc81d5bea9d8a4632a567a6825b7b8c604768d25 /xmake/modules/core/tools/gcc.lua
parent3b74bb00d24587b4768ac10c9ef4222f01ae9225 (diff)
add global build_warning option
Diffstat (limited to 'xmake/modules/core/tools/gcc.lua')
-rw-r--r--xmake/modules/core/tools/gcc.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/xmake/modules/core/tools/gcc.lua b/xmake/modules/core/tools/gcc.lua
index 38ad7c8fd..5418ecf27 100644
--- a/xmake/modules/core/tools/gcc.lua
+++ b/xmake/modules/core/tools/gcc.lua
@@ -21,6 +21,7 @@
-- imports
import("core.base.option")
import("core.base.colors")
+import("core.base.global")
import("core.project.config")
import("core.project.project")
import("core.language.language")
@@ -477,7 +478,7 @@ function compile(self, sourcefile, objectfile, dependinfo, flags)
{
function (ok, outdata, errdata)
-- show warnings?
- if ok and errdata and #errdata > 0 and (option.get("diagnosis") or option.get("warning")) then
+ if ok and errdata and #errdata > 0 and (option.get("diagnosis") or option.get("warning") or global.get("build_warning")) then
local lines = errdata:split('\n', {plain = true})
if #lines > 0 then
local warnings = table.concat(table.slice(lines, 1, ifelse(#lines > 8, 8, #lines)), "\n")