From 52086e64f363bfefc91688efa09ad20f485bcbea Mon Sep 17 00:00:00 2001 From: ruki Date: Sun, 5 Apr 2020 22:19:35 +0800 Subject: improve dependent time for objectfile --- xmake/modules/private/action/build/object.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 -- cgit v1.3.1