summaryrefslogtreecommitdiff
path: root/xmake/core/tool
diff options
context:
space:
mode:
authorruki <[email protected]>2016-07-14 09:18:37 +0800
committerruki <[email protected]>2016-07-14 09:18:37 +0800
commit6c2d3f0ea4d0ccdb10199bc9462b0dc44ddc8a9a (patch)
tree268de1524680eafc5846ecd731eda7b454b05197 /xmake/core/tool
parente20c540cbde1694c683bbc3b8c19158bbde57985 (diff)
add colors for verbose info
Diffstat (limited to 'xmake/core/tool')
-rw-r--r--xmake/core/tool/archiver.lua9
-rw-r--r--xmake/core/tool/compiler.lua9
-rw-r--r--xmake/core/tool/linker.lua9
3 files changed, 18 insertions, 9 deletions
diff --git a/xmake/core/tool/archiver.lua b/xmake/core/tool/archiver.lua
index 3b0873ffe..2b539ca33 100644
--- a/xmake/core/tool/archiver.lua
+++ b/xmake/core/tool/archiver.lua
@@ -29,6 +29,7 @@ local path = require("base/path")
local utils = require("base/utils")
local table = require("base/table")
local string = require("base/string")
+local option = require("base/option")
local config = require("project/config")
local sandbox = require("sandbox/sandbox")
local platform = require("platform/platform")
@@ -273,9 +274,11 @@ function archiver:check(flags)
local ok, errors = sandbox.load(ltool.check, flags)
-- trace
- utils.verbose("checking for the flags %s ... %s", flags, utils.ifelse(ok, "ok", "no"))
- if not ok then
- utils.verbose(errors)
+ if option.get("verbose") then
+ utils.cprint("checking for the flags %s ... %s", flags, utils.ifelse(ok, "${green}ok", "${red}no"))
+ if not ok then
+ utils.cprint("${red}" .. errors or "")
+ end
end
-- save the checked result
diff --git a/xmake/core/tool/compiler.lua b/xmake/core/tool/compiler.lua
index 2de971c73..1f983b60a 100644
--- a/xmake/core/tool/compiler.lua
+++ b/xmake/core/tool/compiler.lua
@@ -29,6 +29,7 @@ local path = require("base/path")
local utils = require("base/utils")
local table = require("base/table")
local string = require("base/string")
+local option = require("base/option")
local tool = require("tool/tool")
local config = require("project/config")
local sandbox = require("sandbox/sandbox")
@@ -466,9 +467,11 @@ function compiler:check(flags)
local ok, errors = sandbox.load(ctool.check, flags)
-- trace
- utils.verbose("checking for the flags %s ... %s", flags, utils.ifelse(ok, "ok", "no"))
- if not ok then
- utils.verbose(errors)
+ if option.get("verbose") then
+ utils.cprint("checking for the flags %s ... %s", flags, utils.ifelse(ok, "${green}ok", "${red}no"))
+ if not ok then
+ utils.cprint("${red}" .. errors or "")
+ end
end
-- save the checked result
diff --git a/xmake/core/tool/linker.lua b/xmake/core/tool/linker.lua
index cca0d8275..5d01bd3cd 100644
--- a/xmake/core/tool/linker.lua
+++ b/xmake/core/tool/linker.lua
@@ -29,6 +29,7 @@ local path = require("base/path")
local utils = require("base/utils")
local table = require("base/table")
local string = require("base/string")
+local option = require("base/option")
local config = require("project/config")
local sandbox = require("sandbox/sandbox")
local platform = require("platform/platform")
@@ -391,9 +392,11 @@ function linker:check(flags)
local ok, errors = sandbox.load(ltool.check, flags)
-- trace
- utils.verbose("checking for the flags %s ... %s", flags, utils.ifelse(ok, "ok", "no"))
- if not ok then
- utils.verbose(errors)
+ if option.get("verbose") then
+ utils.cprint("checking for the flags %s ... %s", flags, utils.ifelse(ok, "${green}ok", "${red}no"))
+ if not ok then
+ utils.cprint("${red}" .. errors or "")
+ end
end
-- save the checked result