diff options
Diffstat (limited to 'xmake/plugins/project/make/makefile.lua')
| -rw-r--r-- | xmake/plugins/project/make/makefile.lua | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/xmake/plugins/project/make/makefile.lua b/xmake/plugins/project/make/makefile.lua index 7b0ec8f60..87c3b6f55 100644 --- a/xmake/plugins/project/make/makefile.lua +++ b/xmake/plugins/project/make/makefile.lua @@ -192,10 +192,18 @@ end -- make objects function _make_objects(makefile, target, sourcekind, sourcebatch, sourceflags) - - -- make them + local handled_objects = target:data("makefile.handled_objects") + if not handled_objects then + handled_objects = {} + target:data_set("makefile.handled_objects", handled_objects) + end for index, objectfile in ipairs(sourcebatch.objectfiles) do - _make_object(makefile, target, sourcebatch.sourcefiles[index], objectfile, sourceflags) + -- remove repeat + -- this is because some rules will repeatedly bind the same sourcekind, e.g. `rule("c++.build.modules.builder")` + if not handled_objects[objectfile] then + _make_object(makefile, target, sourcebatch.sourcefiles[index], objectfile, sourceflags) + handled_objects[objectfile] = true + end end end |
