From b67d2ce203e9535e0f2004ce7f81a690a79ec0ca Mon Sep 17 00:00:00 2001 From: ruki Date: Fri, 26 Jan 2024 22:44:05 +0800 Subject: improve more warnings --- xmake/modules/core/tools/cparser.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'xmake/modules/core/tools/cparser.lua') diff --git a/xmake/modules/core/tools/cparser.lua b/xmake/modules/core/tools/cparser.lua index 0eb9847f0..ab6972e71 100644 --- a/xmake/modules/core/tools/cparser.lua +++ b/xmake/modules/core/tools/cparser.lua @@ -22,6 +22,7 @@ import("core.base.option") import("core.project.config") import("core.project.project") +import("core.project.policy") import("core.language.language") -- init it @@ -154,7 +155,7 @@ function compargv(self, sourcefile, objectfile, flags) end -- compile the source file -function compile(self, sourcefile, objectfile, dependinfo, flags) +function compile(self, sourcefile, objectfile, dependinfo, flags, opt) -- ensure the object directory os.mkdir(path.directory(objectfile)) @@ -198,7 +199,7 @@ function compile(self, sourcefile, objectfile, dependinfo, flags) function (ok, warnings) -- print some warnings - if warnings and #warnings > 0 and (option.get("verbose") or option.get("warning")) then + if warnings and #warnings > 0 and policy.build_warnings(opt) then cprint("${color.warning}%s", table.concat(table.slice(warnings:split('\n'), 1, 8), '\n')) end end -- cgit v1.3.1