From c85d3d058f04018db42a3753dd25adededecd071 Mon Sep 17 00:00:00 2001 From: TitanSnow Date: Sat, 13 May 2017 08:55:01 +0800 Subject: ccache -> $(CCACHE) --- xmake/plugins/project/makefile/makefile.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'xmake/plugins/project/makefile/makefile.lua') diff --git a/xmake/plugins/project/makefile/makefile.lua b/xmake/plugins/project/makefile/makefile.lua index e31de2f83..202dfa63a 100644 --- a/xmake/plugins/project/makefile/makefile.lua +++ b/xmake/plugins/project/makefile/makefile.lua @@ -120,6 +120,12 @@ function _make_object(makefile, target, sourcefile, objectfile) command = format("%s$(%s)%s", command:sub(1, p - 1), sourcekind:upper(), command:sub(e + 1)) end + -- replace ccache to $(CCACHE) + p, e = command:find("ccache", 1, true) + if p then + command = format("%s$(%s)%s", command:sub(1, p - 1), "CCACHE", command:sub(e + 1)) + end + -- make head makefile:printf("%s:", objectfile) @@ -173,6 +179,12 @@ function _make_single_object(makefile, target, sourcekind, sourcebatch) command = format("%s$(%s)%s", command:sub(1, p - 1), sourcekind:upper(), command:sub(e + 1)) end + -- replace ccache to $(CCACHE) + p, e = command:find("ccache", 1, true) + if p then + command = format("%s$(%s)%s", command:sub(1, p - 1), "CCACHE", command:sub(e + 1)) + end + -- make head makefile:printf("%s:", objectfiles) @@ -301,6 +313,8 @@ end -- make all function _make_all(makefile) + -- make variables for ccache + makefile:print("CCACHE=ccache") -- make variables for source kinds for sourcekind, _ in pairs(language.sourcekinds()) do local shellname = tool.shellname(sourcekind) -- cgit v1.3.1