From c0a237b461bb03a73f3ba93c1f6b1637f3d613ce Mon Sep 17 00:00:00 2001 From: ruki Date: Sun, 10 Jul 2016 21:28:04 +0800 Subject: fix the current directory changed when building --- xmake/plugins/project/makefile.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'xmake/plugins/project/makefile.lua') diff --git a/xmake/plugins/project/makefile.lua b/xmake/plugins/project/makefile.lua index 7620293ae..61300eb4c 100755 --- a/xmake/plugins/project/makefile.lua +++ b/xmake/plugins/project/makefile.lua @@ -25,6 +25,7 @@ import("core.tool.tool") import("core.tool.linker") import("core.tool.archiver") import("core.tool.compiler") +import("core.project.config") import("core.project.project") -- get log makefile @@ -78,8 +79,7 @@ function _make_object(makefile, target, srcfile, objfile) end -- make command - local ccache = tool.shellname("ccache") - local command = compiler.compcmd(srcfile, objfile, target) + local command = compiler.compcmd(srcfile, objfile, target) -- make head makefile:printf("%s:", objfile) @@ -88,7 +88,7 @@ function _make_object(makefile, target, srcfile, objfile) makefile:print(" %s", srcfile) -- make body - makefile:print("\t@echo %scompiling.$(mode) %s", ifelse(ccache, "ccache ", ""), srcfile) + makefile:print("\t@echo %scompiling.$(mode) %s", ifelse(config.get("ccache"), "ccache ", ""), srcfile) makefile:print("\t@xmake l %$(VERBOSE) verbose \"%s\"", command:encode()) makefile:print("\t@xmake l mkdir %s", path.directory(objfile)) makefile:print("\t@%s > %s 2>&1", command, _logfile()) -- cgit v1.3.1