summaryrefslogtreecommitdiff
path: root/xmake/core/project
diff options
context:
space:
mode:
authorruki <[email protected]>2020-10-05 23:33:47 +0800
committerruki <[email protected]>2020-10-05 23:33:47 +0800
commit3c24b8c6ebecb87f7171b74ac2695e37f32a9612 (patch)
tree174f1345ecc6897ac095bb9c5f353424a5df3c27 /xmake/core/project
parent68640a3c5df67d21022e727b25938d607c958d9b (diff)
fix order of target:objectfiles()
Diffstat (limited to 'xmake/core/project')
-rw-r--r--xmake/core/project/target.lua8
1 files changed, 5 insertions, 3 deletions
diff --git a/xmake/core/project/target.lua b/xmake/core/project/target.lua
index 5ee5d54c3..ab6a90b51 100644
--- a/xmake/core/project/target.lua
+++ b/xmake/core/project/target.lua
@@ -1197,7 +1197,11 @@ function _instance:objectfiles()
-- get object files from source batches
local objectfiles = {}
local batchcount = 0
- for _, sourcebatch in pairs(self:sourcebatches()) do
+ local sourcebatches = self:sourcebatches()
+ local orderkeys = table.keys(sourcebatches)
+ table.sort(orderkeys) -- @note we need guarantee the order of objectfiles for depend.is_changed() and etc.
+ for _, k in ipairs(orderkeys) do
+ local sourcebatch = sourcebatches[k]
table.join2(objectfiles, sourcebatch.objectfiles)
batchcount = batchcount + 1
end
@@ -1223,8 +1227,6 @@ function _instance:objectfiles()
-- cache it
self._OBJECTFILES = objectfiles
-
- -- ok?
return objectfiles
end