From 6c2d3f0ea4d0ccdb10199bc9462b0dc44ddc8a9a Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 14 Jul 2016 09:18:37 +0800 Subject: add colors for verbose info --- xmake/core/tool/compiler.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'xmake/core/tool/compiler.lua') 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 -- cgit v1.3.1