summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2020-04-05 22:19:35 +0800
committerruki <[email protected]>2020-04-05 22:19:35 +0800
commit52086e64f363bfefc91688efa09ad20f485bcbea (patch)
tree3b21d7eb5d3dd55a4b822b88e6b199c35fed8824
parent178274fa3eb46aa0e5b9dae97355a31907816cde (diff)
improve dependent time for objectfile
-rw-r--r--xmake/modules/private/action/build/object.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/xmake/modules/private/action/build/object.lua b/xmake/modules/private/action/build/object.lua
index 982789220..b6e5d63e1 100644
--- a/xmake/modules/private/action/build/object.lua
+++ b/xmake/modules/private/action/build/object.lua
@@ -45,8 +45,10 @@ function _do_build_file(target, sourcefile, opt)
local dependinfo = option.get("rebuild") and {} or (depend.load(dependfile) or {})
-- 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
local depvalues = {compinst:program(), compflags}
- if not depend.is_changed(dependinfo, {lastmtime = os.mtime(objectfile), values = depvalues}) then
+ if not depend.is_changed(dependinfo, {lastmtime = os.mtime(dependfile), values = depvalues}) then
return
end