From 1cbfdb2503e78ace177846b09eecc79bf5810832 Mon Sep 17 00:00:00 2001 From: ruki Date: Tue, 7 Jun 2016 22:17:48 +0800 Subject: fix ccache option bug --- xmake/actions/build/builder.lua | 7 ++++++- xmake/core/base/option.lua | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/xmake/actions/build/builder.lua b/xmake/actions/build/builder.lua index bec34df86..d6c2c3614 100755 --- a/xmake/actions/build/builder.lua +++ b/xmake/actions/build/builder.lua @@ -92,8 +92,13 @@ function _build_object(target, index) end -- make command - local ccache = tool.shellname("ccache") local command = compiler.command(target, sourcefile, objectfile) + + -- uses ccache + local ccache = nil + if config.get("ccache") then + ccache = tool.shellname("ccache") + end if ccache then command = ccache:append(command, " ") end diff --git a/xmake/core/base/option.lua b/xmake/core/base/option.lua index 3760c42d1..4172c816e 100644 --- a/xmake/core/base/option.lua +++ b/xmake/core/base/option.lua @@ -277,8 +277,8 @@ function option.init(menu) -- value is "true" or "false", translate it if type(value) == "string" then - if value == "true" then value = true - elseif value == "false" then value = false + if value == "true" or value == "yes" or value == "y" then value = true + elseif value == "false" or value == "no" or value == "n" then value = false end end -- cgit v1.3.1