summaryrefslogtreecommitdiff
path: root/xmake/plugins/project/make/makefile.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2022-08-14 11:30:28 +0800
committerruki <[email protected]>2022-08-14 11:30:42 +0800
commit077fc878bc8da7804cf36765bf54c687dc95f61d (patch)
treeffb1ac54de08249980cdf00c6bf64dacb256a1b2 /xmake/plugins/project/make/makefile.lua
parent4560a3458148449eaa959a8a3a62e2c63cfaabba (diff)
improve cmakelist generator
Diffstat (limited to 'xmake/plugins/project/make/makefile.lua')
-rw-r--r--xmake/plugins/project/make/makefile.lua14
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