summaryrefslogtreecommitdiff
path: root/xmake/plugins/project/make
diff options
context:
space:
mode:
authorruki <[email protected]>2022-08-15 11:19:15 +0800
committerGitHub <[email protected]>2022-08-15 11:19:15 +0800
commit4e4559e121c1ea1387874809fb448548dc0dba80 (patch)
treea994abe7a9836df6afe1bd201cda2dd2864b9d99 /xmake/plugins/project/make
parent595a078ba33abd374cf900a07570222151caf605 (diff)
parentff971cdfeb55701078e894c380939ed7146b5638 (diff)
Merge pull request #2673 from xmake-io/generator
improve generator for cxxmodules
Diffstat (limited to 'xmake/plugins/project/make')
-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