From 081f05d3aea024d6c025435c879cc711e60ce74e Mon Sep 17 00:00:00 2001 From: star-hengxing Date: Tue, 7 Feb 2023 14:40:40 +0800 Subject: fix build warning --- xmake/modules/core/tools/clang_cl.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xmake/modules/core/tools/clang_cl.lua b/xmake/modules/core/tools/clang_cl.lua index 1c993a6b6..b245fdb53 100644 --- a/xmake/modules/core/tools/clang_cl.lua +++ b/xmake/modules/core/tools/clang_cl.lua @@ -23,6 +23,7 @@ inherit("cl") import("core.base.option") import("core.base.tty") import("core.base.colors") +import("core.project.policy") -- init it function init(self) @@ -164,7 +165,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 policy.build_warnings()) then local lines = errdata:split('\n', {plain = true}) if #lines > 0 then local warnings = table.concat(table.slice(lines, 1, (#lines > 8 and 8 or #lines)), "\n") -- cgit v1.3.1 From d48d11223bd3bf81213c36a22a4fbd357c18963a Mon Sep 17 00:00:00 2001 From: star-hengxing Date: Tue, 7 Feb 2023 15:05:43 +0800 Subject: improve build warning --- xmake/modules/core/tools/clang_cl.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xmake/modules/core/tools/clang_cl.lua b/xmake/modules/core/tools/clang_cl.lua index b245fdb53..07b8691f7 100644 --- a/xmake/modules/core/tools/clang_cl.lua +++ b/xmake/modules/core/tools/clang_cl.lua @@ -165,7 +165,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") or policy.build_warnings()) then + if ok and errdata and #errdata > 0 and policy.build_warnings() then local lines = errdata:split('\n', {plain = true}) if #lines > 0 then local warnings = table.concat(table.slice(lines, 1, (#lines > 8 and 8 or #lines)), "\n") -- cgit v1.3.1