summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2023-09-01 00:42:33 +0800
committerruki <[email protected]>2023-09-01 00:42:33 +0800
commit85f19d35241297cc92e41fe437f8ed27e5e8e3d2 (patch)
tree110f1e2fcc950507998b5911e12df190a2d42658
parent6dc3f73929a7dde224d77bbcd5db54be22958cda (diff)
rename always_changed to dryrun
-rw-r--r--xmake/actions/build/kinds/binary.lua2
-rw-r--r--xmake/actions/build/kinds/shared.lua2
-rw-r--r--xmake/actions/build/kinds/static.lua2
-rw-r--r--xmake/actions/config/configfiles.lua2
-rw-r--r--xmake/modules/core/project/depend.lua10
-rw-r--r--xmake/rules/cuda/devlink/devlink.lua2
6 files changed, 9 insertions, 11 deletions
diff --git a/xmake/actions/build/kinds/binary.lua b/xmake/actions/build/kinds/binary.lua
index 55454f262..39535a492 100644
--- a/xmake/actions/build/kinds/binary.lua
+++ b/xmake/actions/build/kinds/binary.lua
@@ -74,7 +74,7 @@ function _do_link_target(target, opt)
assert(linkinst:link(objectfiles, targetfile, {linkflags = linkflags}))
end
- end, {dependfile = target:dependfile(), lastmtime = os.mtime(target:targetfile()), values = depvalues, files = depfiles, always_changed = dryrun})
+ end, {dependfile = target:dependfile(), lastmtime = os.mtime(target:targetfile()), values = depvalues, files = depfiles, dryrun = dryrun})
end
-- on link the given target
diff --git a/xmake/actions/build/kinds/shared.lua b/xmake/actions/build/kinds/shared.lua
index 4363d1901..27ff93689 100644
--- a/xmake/actions/build/kinds/shared.lua
+++ b/xmake/actions/build/kinds/shared.lua
@@ -74,7 +74,7 @@ function _do_link_target(target, opt)
assert(linkinst:link(objectfiles, targetfile, {linkflags = linkflags}))
end
- end, {dependfile = target:dependfile(), lastmtime = os.mtime(target:targetfile()), values = depvalues, files = depfiles, always_changed = dryrun})
+ end, {dependfile = target:dependfile(), lastmtime = os.mtime(target:targetfile()), values = depvalues, files = depfiles, dryrun = dryrun})
end
-- on link the given target
diff --git a/xmake/actions/build/kinds/static.lua b/xmake/actions/build/kinds/static.lua
index 9d9ffdaf9..517aea585 100644
--- a/xmake/actions/build/kinds/static.lua
+++ b/xmake/actions/build/kinds/static.lua
@@ -74,7 +74,7 @@ function _do_link_target(target, opt)
assert(linkinst:link(objectfiles, targetfile, {linkflags = linkflags}))
end
- end, {dependfile = target:dependfile(), lastmtime = os.mtime(target:targetfile()), values = depvalues, files = depfiles, always_changed = dryrun})
+ end, {dependfile = target:dependfile(), lastmtime = os.mtime(target:targetfile()), values = depvalues, files = depfiles, dryrun = dryrun})
end
-- on link the given target
diff --git a/xmake/actions/config/configfiles.lua b/xmake/actions/config/configfiles.lua
index 1cf49881a..2b30f53af 100644
--- a/xmake/actions/config/configfiles.lua
+++ b/xmake/actions/config/configfiles.lua
@@ -328,7 +328,7 @@ function main(opt)
end, {files = srcinfo.srcfile,
lastmtime = os.mtime(dstfile),
dependfile = srcinfo.dependfile,
- always_changed = opt.force})
+ changed = opt.force})
end
-- leave project directory
diff --git a/xmake/modules/core/project/depend.lua b/xmake/modules/core/project/depend.lua
index 9f386c8f1..c66830521 100644
--- a/xmake/modules/core/project/depend.lua
+++ b/xmake/modules/core/project/depend.lua
@@ -157,16 +157,15 @@ end
--
-- end, {dependfile = "/xx/xx",
-- values = {compinst:program(), compflags},
--- files = {sourcefile, ...},
--- always_changed = false})
+-- files = {sourcefile, ...}})
--
function on_changed(callback, opt)
-- init option
opt = opt or {}
- -- always changed? we only do callback directly
- if opt.always_changed then
+ -- dry run? we only do callback directly and do not change any status
+ if opt.dryrun then
return callback()
end
@@ -180,9 +179,8 @@ function on_changed(callback, opt)
end
-- load dependent info
- local dependinfo = option.get("rebuild") and {} or (load(dependfile) or {})
+ local dependinfo = opt.changed and {} or (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
if not is_changed(dependinfo, {lastmtime = opt.lastmtime or os.mtime(dependfile), values = opt.values, files = opt.files}) then
diff --git a/xmake/rules/cuda/devlink/devlink.lua b/xmake/rules/cuda/devlink/devlink.lua
index 9b76c9775..50ef93597 100644
--- a/xmake/rules/cuda/devlink/devlink.lua
+++ b/xmake/rules/cuda/devlink/devlink.lua
@@ -107,5 +107,5 @@ function main(target, opt)
assert(linkinst:link(objectfiles, targetfile, {linkflags = linkflags}))
end
- end, {dependfile = target:dependfile(targetfile), lastmtime = os.mtime(targetfile), values = depvalues, files = depfiles, always_changed = dryrun})
+ end, {dependfile = target:dependfile(targetfile), lastmtime = os.mtime(targetfile), values = depvalues, files = depfiles, dryrun = dryrun})
end