summaryrefslogtreecommitdiff
path: root/xmake/modules/core/project/depend.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2021-08-10 22:37:09 +0800
committerruki <[email protected]>2021-08-10 22:37:09 +0800
commit726000c395eb190fcec40e2d60d2059aeddac196 (patch)
tree18ca9cbe23b2ac7bd45e100885a7682a58b940aa /xmake/modules/core/project/depend.lua
parentae334d9bc2c8b3c9e5595789db51561c238ec1dc (diff)
fix depend.lua for link
Diffstat (limited to 'xmake/modules/core/project/depend.lua')
-rw-r--r--xmake/modules/core/project/depend.lua15
1 files changed, 9 insertions, 6 deletions
diff --git a/xmake/modules/core/project/depend.lua b/xmake/modules/core/project/depend.lua
index cb25db359..89a517c07 100644
--- a/xmake/modules/core/project/depend.lua
+++ b/xmake/modules/core/project/depend.lua
@@ -78,8 +78,8 @@ end
function is_changed(dependinfo, opt)
-- empty depend info? always be changed
- local files = dependinfo.files or {}
- local values = dependinfo.values or {}
+ local files = table.wrap(dependinfo.files)
+ local values = table.wrap(dependinfo.values)
if #files == 0 and #values == 0 then
return true
end
@@ -102,7 +102,7 @@ function is_changed(dependinfo, opt)
-- check the dependent values are changed?
local depvalues = values
- local optvalues = opt.values or {}
+ local optvalues = table.wrap(opt.values)
if #depvalues ~= #optvalues then
return true
end
@@ -124,8 +124,11 @@ function is_changed(dependinfo, opt)
end
-- check the dependent files list are changed?
- local optfiles = opt.files
- if optfiles then
+ if opt.files then
+ local optfiles = table.wrap(opt.files)
+ if #files ~= #optfiles then
+ return true
+ end
for idx, file in ipairs(files) do
if file ~= optfiles[idx] then
return true
@@ -178,7 +181,7 @@ function on_changed(callback, opt)
-- need build this object?
-- @note we use mtime(dependfile) instead of mtime(objectfile) to ensure the object file is is fully compiled.
-- @see https://github.com/xmake-io/xmake/issues/748
- if not is_changed(dependinfo, {lastmtime = opt.lastmtime or os.mtime(dependfile), values = opt.values}) then
+ if not is_changed(dependinfo, {lastmtime = opt.lastmtime or os.mtime(dependfile), values = opt.values, files = opt.files}) then
return
end