summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2020-06-21 13:49:57 +0800
committerruki <[email protected]>2020-06-21 13:49:57 +0800
commita4951b04d782465f70d36e314355e4d1108f2ba8 (patch)
treea1b4e16b855aad383d5d979fdaf7b9262df0aca2
parentfc477da1337332b83ceef15f02ce6b69dc1ee56e (diff)
fix repeat sourcefiles
-rw-r--r--xmake/core/project/target.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/xmake/core/project/target.lua b/xmake/core/project/target.lua
index 1579cd133..218ef6748 100644
--- a/xmake/core/project/target.lua
+++ b/xmake/core/project/target.lua
@@ -1085,6 +1085,7 @@ function _instance:sourcefiles()
local count = 0
local sourcefiles = {}
local sourcefiles_deleted = {}
+ local sourcefiles_inserted = {}
local deleted_count = 0
for _, file in ipairs(table.wrap(files)) do
@@ -1120,8 +1121,9 @@ function _instance:sourcefiles()
if deleted then
deleted_count = deleted_count + 1
sourcefiles_deleted[sourcefile] = true
- else
+ elseif not sourcefiles_inserted[sourcefile] then
table.insert(sourcefiles, sourcefile)
+ sourcefiles_inserted[sourcefile] = true
end
end
end