summaryrefslogtreecommitdiff
path: root/xmake/modules
diff options
context:
space:
mode:
authorruki <[email protected]>2018-11-04 22:20:13 +0800
committerruki <[email protected]>2018-11-04 22:20:13 +0800
commitd3d05b0c620dbfc318d4c693bc2fb7b556d51d3c (patch)
treea91579ba8362498e531c01081d8fe80906da142d /xmake/modules
parent9d22026291016915298cd4cf8b004bef4b6faaec (diff)
improve diagnosis info
Diffstat (limited to 'xmake/modules')
-rw-r--r--xmake/modules/core/tools/gcc.lua2
-rw-r--r--xmake/modules/lib/detect/check_cxsnippets.lua8
-rw-r--r--xmake/modules/lib/detect/has_flags.lua8
-rw-r--r--xmake/modules/package/tools/xmake.lua12
-rw-r--r--xmake/modules/privilege/sudo.lua2
5 files changed, 16 insertions, 16 deletions
diff --git a/xmake/modules/core/tools/gcc.lua b/xmake/modules/core/tools/gcc.lua
index b1608b5ba..551a158e3 100644
--- a/xmake/modules/core/tools/gcc.lua
+++ b/xmake/modules/core/tools/gcc.lua
@@ -491,7 +491,7 @@ function _compile1(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 (option.get("diagnosis") or option.get("warning")) then
cprint("${yellow}%s", table.concat(table.slice(warnings:split('\n'), 1, 8), '\n'))
end
end
diff --git a/xmake/modules/lib/detect/check_cxsnippets.lua b/xmake/modules/lib/detect/check_cxsnippets.lua
index 0cbee0153..d2e272714 100644
--- a/xmake/modules/lib/detect/check_cxsnippets.lua
+++ b/xmake/modules/lib/detect/check_cxsnippets.lua
@@ -197,7 +197,7 @@ function main(snippets, opt)
os.tryrm(binaryfile)
-- trace
- if opt.verbose or option.get("verbose") then
+ if opt.verbose or option.get("verbose") or option.get("diagnosis") then
local kind = ifelse(sourcekind == "cc", "c", "c++")
if #includes > 0 then
cprint("checking for the %s includes %s ... %s", kind, table.concat(includes, ", "), ifelse(ok, "${green}ok", "${red}no"))
@@ -214,9 +214,9 @@ function main(snippets, opt)
for _, snippet in ipairs(snippets) do
cprint("checking for the %s snippet %s ... %s", kind, snippet:sub(1, 16), ifelse(ok, "${green}ok", "${red}no"))
end
- if errors and #errors > 0 then
- cprint("${dim red}check error:${clear}${dim} %s", errors)
- end
+ end
+ if errors and #errors > 0 and option.get("diagnosis") then
+ cprint("${yellow}checkinfo:${clear dim} %s", errors)
end
-- ok?
diff --git a/xmake/modules/lib/detect/has_flags.lua b/xmake/modules/lib/detect/has_flags.lua
index 6398e62e6..66bdcfece 100644
--- a/xmake/modules/lib/detect/has_flags.lua
+++ b/xmake/modules/lib/detect/has_flags.lua
@@ -115,11 +115,11 @@ function main(name, flags, opt)
_g._checking = nil
-- trace
- if option.get("verbose") or opt.verbose then
+ if option.get("verbose") or option.get("diagnosis") or opt.verbose then
cprint("checking for the flags(%s) %s ... %s", path.filename(tool.program), table.concat(flags, " "), ifelse(result, "${green}ok", "${red}no"))
- if errors and #errors > 0 then
- cprint("${dim red}check error:${clear}${dim} %s", errors:trim())
- end
+ end
+ if errors and #errors > 0 and option.get("diagnosis") then
+ cprint("${yellow}checkinfo:${clear dim} %s", errors:trim())
end
-- save result to cache
diff --git a/xmake/modules/package/tools/xmake.lua b/xmake/modules/package/tools/xmake.lua
index 6a5772e8f..4b625342b 100644
--- a/xmake/modules/package/tools/xmake.lua
+++ b/xmake/modules/package/tools/xmake.lua
@@ -54,8 +54,8 @@ function install(package, configs)
if option.get("verbose") then
table.insert(argv, "-v")
end
- if option.get("backtrace") then
- table.insert(argv, "--backtrace")
+ if option.get("diagnosis") then
+ table.insert(argv, "--diagnosis")
end
os.vrunv("xmake", argv)
@@ -64,8 +64,8 @@ function install(package, configs)
if option.get("verbose") then
table.insert(argv, "-v")
end
- if option.get("backtrace") then
- table.insert(argv, "--backtrace")
+ if option.get("diagnosis") then
+ table.insert(argv, "--diagnosis")
end
os.vrunv("xmake", argv)
@@ -74,8 +74,8 @@ function install(package, configs)
if option.get("verbose") then
table.insert(argv, "-v")
end
- if option.get("backtrace") then
- table.insert(argv, "--backtrace")
+ if option.get("diagnosis") then
+ table.insert(argv, "--diagnosis")
end
os.vrunv("xmake", argv)
end
diff --git a/xmake/modules/privilege/sudo.lua b/xmake/modules/privilege/sudo.lua
index bd53ff187..6e6863745 100644
--- a/xmake/modules/privilege/sudo.lua
+++ b/xmake/modules/privilege/sudo.lua
@@ -79,7 +79,7 @@ function _lua(runner, luafile, luaargv)
-- init argv
local argv = {"lua", "--root"}
- for _, name in ipairs({"file", "project", "backtrace", "verbose", "quiet", "yes"}) do
+ for _, name in ipairs({"file", "project", "diagnosis", "verbose", "quiet", "yes"}) do
local value = option.get(name)
if type(value) == "string" then
table.insert(argv, "--" .. name .. "=" .. value)