diff options
| author | ruki <[email protected]> | 2020-03-03 00:33:45 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-03-02 21:22:32 +0800 |
| commit | 35fd0056a576861e1e26d21fd7ffe8a8682d7c61 (patch) | |
| tree | c5ad18538ceb7a5d7c39fa9dd7af517f0f7d5d04 /xmake/plugins/project/make/makefile.lua | |
| parent | 30e5c22acf242194f9c7944341ccca75076be5f2 (diff) | |
fix generate makefile
Diffstat (limited to 'xmake/plugins/project/make/makefile.lua')
| -rw-r--r-- | xmake/plugins/project/make/makefile.lua | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/xmake/plugins/project/make/makefile.lua b/xmake/plugins/project/make/makefile.lua index c2c44508d..a3eea6c64 100644 --- a/xmake/plugins/project/make/makefile.lua +++ b/xmake/plugins/project/make/makefile.lua @@ -20,6 +20,7 @@ -- imports import("core.tool.compiler") +import("core.project.config") import("core.project.project") import("core.language.language") import("core.platform.platform") @@ -156,8 +157,10 @@ function _make_object(makefile, target, sourcefile, objectfile, sourceflags) local compflags = sourceflags[sourcefile] -- make command - local macro = "$(" .. target:name() .. '_' .. sourcekind:upper() .. "FLAGS)" + local macro = "$\01" .. target:name() .. '_' .. sourcekind:upper() .. "FLAGS\02" local command = compiler.compcmd(sourcefile, objectfile, {target = target, compflags = table.join(macro, compflags)}) + command = command:gsub('\01', '(') + command = command:gsub('\02', ')') -- replace program to $(XX) local p, e = command:find("\"" .. program .. "\"", 1, true) @@ -173,7 +176,7 @@ function _make_object(makefile, target, sourcefile, objectfile, sourceflags) end -- replace ccache to $(CCACHE) - local ccache = find_tool("ccache") + local ccache = config.get("ccache") ~= false and find_tool("ccache") if ccache then p, e = command:find(ccache.program, 1, true) if p then |
