From f50cc8971ad01966cb5bfbcd2bef354fdef42cd8 Mon Sep 17 00:00:00 2001 From: ruki Date: Sat, 11 Nov 2017 21:23:57 +0800 Subject: improve project plugin --- xmake/plugins/project/makefile/makefile.lua | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (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 7f50d569a..d4061359f 100644 --- a/xmake/plugins/project/makefile/makefile.lua +++ b/xmake/plugins/project/makefile/makefile.lua @@ -306,16 +306,13 @@ function _make_target(makefile, target) -- build source batches for sourcekind, sourcebatch in pairs(target:sourcebatches()) do - - -- compile source files to single object at the same time? - if type(sourcebatch.objectfiles) == "string" then - - -- make single object - _make_single_object(makefile, target, sourcekind, sourcebatch) - else - - -- make each objects - _make_each_objects(makefile, target, sourcekind, sourcebatch) + if not sourcebatch.rulename then + -- compile source files to single object at once + if type(sourcebatch.objectfiles) == "string" then + _make_single_object(makefile, target, sourcekind, sourcebatch) + else + _make_each_objects(makefile, target, sourcekind, sourcebatch) + end end end end @@ -359,7 +356,9 @@ function _make_all(makefile) for targetname, target in pairs(project.targets()) do if not target:isphony() then for sourcekind, sourcebatch in pairs(target:sourcebatches()) do - makefile:print("%s_%s=%s", targetname, sourcekind:upper(), os.args(compiler.compflags(sourcebatch.sourcefiles, {target = target, sourcekind = sourcekind}))) + if not sourcebatch.rulename then + makefile:print("%s_%s=%s", targetname, sourcekind:upper(), os.args(compiler.compflags(sourcebatch.sourcefiles, {target = target, sourcekind = sourcekind}))) + end end makefile:print("%s_%s=%s", targetname, target:linker():kind():upper(), os.args(target:linkflags())) end -- cgit v1.3.1