summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2023-09-01 00:45:44 +0800
committerruki <[email protected]>2023-09-01 00:45:44 +0800
commitabc48d4f230d471ebf53051bf36f2a0ecd94077e (patch)
tree8027e583c9eb56d976b5b1abcf3bbd20bd8dc7b9
parent85f19d35241297cc92e41fe437f8ed27e5e8e3d2 (diff)
replace on_changed
-rw-r--r--xmake/actions/build/kinds/binary.lua7
-rw-r--r--xmake/actions/build/kinds/shared.lua7
-rw-r--r--xmake/actions/build/kinds/static.lua7
-rw-r--r--xmake/rules/c++/modules/modules_support/clang.lua17
-rw-r--r--xmake/rules/c++/modules/modules_support/gcc.lua16
-rw-r--r--xmake/rules/c++/modules/modules_support/msvc.lua16
-rw-r--r--xmake/rules/c++/unity_build/unity_build.lua4
-rw-r--r--xmake/rules/c51/xmake.lua4
-rw-r--r--xmake/rules/cuda/devlink/devlink.lua7
-rw-r--r--xmake/rules/platform/linux/driver/driver_modules.lua4
-rw-r--r--xmake/rules/protobuf/module_parser.lua4
-rw-r--r--xmake/rules/utils/merge_archive/xmake.lua4
-rw-r--r--xmake/rules/utils/symbols/export_all/export_all.lua6
-rw-r--r--xmake/rules/verilator/verilator.lua3
-rw-r--r--xmake/rules/xcode/application/build.lua4
-rw-r--r--xmake/rules/xcode/bundle/xmake.lua4
-rw-r--r--xmake/rules/xcode/framework/xmake.lua4
17 files changed, 66 insertions, 52 deletions
diff --git a/xmake/actions/build/kinds/binary.lua b/xmake/actions/build/kinds/binary.lua
index 39535a492..d9b5b26ba 100644
--- a/xmake/actions/build/kinds/binary.lua
+++ b/xmake/actions/build/kinds/binary.lua
@@ -52,7 +52,7 @@ function _do_link_target(target, opt)
end
local dryrun = option.get("dry-run")
local depvalues = {linkinst:program(), linkflags}
- depend.on_changed(function ()
+ depend._on_changed(function ()
-- the target file
local targetfile = target:targetfile()
@@ -74,7 +74,10 @@ 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, dryrun = dryrun})
+ end, {dependfile = target:dependfile(),
+ lastmtime = os.mtime(target:targetfile()),
+ changed = target:is_rebuilt(),
+ 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 27ff93689..5231641d2 100644
--- a/xmake/actions/build/kinds/shared.lua
+++ b/xmake/actions/build/kinds/shared.lua
@@ -52,7 +52,7 @@ function _do_link_target(target, opt)
end
local dryrun = option.get("dry-run")
local depvalues = {linkinst:program(), linkflags}
- depend.on_changed(function ()
+ depend._on_changed(function ()
-- the target file
local targetfile = target:targetfile()
@@ -74,7 +74,10 @@ 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, dryrun = dryrun})
+ end, {dependfile = target:dependfile(),
+ lastmtime = os.mtime(target:targetfile()),
+ changed = target:is_rebuilt(),
+ 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 517aea585..9a77dfa08 100644
--- a/xmake/actions/build/kinds/static.lua
+++ b/xmake/actions/build/kinds/static.lua
@@ -52,7 +52,7 @@ function _do_link_target(target, opt)
end
local dryrun = option.get("dry-run")
local depvalues = {linkinst:program(), linkflags}
- depend.on_changed(function ()
+ depend._on_changed(function ()
-- the target file
local targetfile = target:targetfile()
@@ -74,7 +74,10 @@ 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, dryrun = dryrun})
+ end, {dependfile = target:dependfile(),
+ lastmtime = os.mtime(target:targetfile()),
+ changed = target:is_rebuilt(),
+ values = depvalues, files = depfiles, dryrun = dryrun})
end
-- on link the given target
diff --git a/xmake/rules/c++/modules/modules_support/clang.lua b/xmake/rules/c++/modules/modules_support/clang.lua
index a65defe53..02989928b 100644
--- a/xmake/rules/c++/modules/modules_support/clang.lua
+++ b/xmake/rules/c++/modules/modules_support/clang.lua
@@ -332,7 +332,7 @@ function generate_dependencies(target, sourcebatch, opt)
local changed = false
for _, sourcefile in ipairs(sourcebatch.sourcefiles) do
local dependfile = target:dependfile(sourcefile)
- depend.on_changed(function()
+ depend._on_changed(function()
if opt.progress then
progress.show(opt.progress, "${color.build.object}generating.module.deps %s", sourcefile)
end
@@ -411,7 +411,7 @@ function generate_dependencies(target, sourcebatch, opt)
end
return {moduleinfo = rawdependinfo}
- end, {dependfile = dependfile, files = {sourcefile}})
+ end, {dependfile = dependfile, files = {sourcefile}, changed = target:is_rebuilt()})
end
return changed
end
@@ -433,7 +433,7 @@ function generate_stl_headerunits_for_batchjobs(target, batchjobs, headerunits,
local bmifile = path.join(stlcachedir, headerunit.name .. get_bmi_extension())
if not os.isfile(bmifile) then
batchjobs:addjob(headerunit.name, function (index, total)
- depend.on_changed(function()
+ depend._on_changed(function()
-- don't build same header unit at the same time
if not common.memcache():get2(headerunit.name, "building") then
common.memcache():set2(headerunit.name, "building", true)
@@ -442,7 +442,8 @@ function generate_stl_headerunits_for_batchjobs(target, batchjobs, headerunits,
os.vrunv(compinst:program(), table.join(compinst:compflags({target = target}), args))
end
- end, {dependfile = target:dependfile(bmifile), files = {headerunit.path}})
+ end, {dependfile = target:dependfile(bmifile), files = {headerunit.path}, changed = target:is_rebuilt()})
+
-- libc++ have a builtin module mapper
if not _use_stdlib(target, "libc++") then
_add_module_to_mapper(target, headerunit.name, bmifile)
@@ -504,7 +505,7 @@ function generate_user_headerunits_for_batchjobs(target, batchjobs, headerunits,
local bmifilename = path.basename(objectfile) .. get_bmi_extension()
local bmifile = path.join(outputdir, bmifilename)
batchjobs:addjob(headerunit.name, function (index, total)
- depend.on_changed(function()
+ depend._on_changed(function()
progress.show((index * 100) / total, "${color.build.object}compiling.headerunit.$(mode) %s", headerunit.name)
local objectdir = path.directory(objectfile)
if not os.isdir(objectdir) then
@@ -523,7 +524,7 @@ function generate_user_headerunits_for_batchjobs(target, batchjobs, headerunits,
end
os.vrunv(compinst:program(), table.join(compinst:compflags({target = target}), args))
- end, {dependfile = target:dependfile(bmifile), files = {headerunit.path}})
+ end, {dependfile = target:dependfile(bmifile), files = {headerunit.path}, changed = target:is_rebuilt()})
_add_module_to_mapper(target, headerunit.name, bmifile)
end, {rootjob = flushjob})
end
@@ -610,11 +611,11 @@ function build_modules_for_batchjobs(target, batchjobs, objectfiles, modules, op
if fileconfig and fileconfig.install then
batchjobs:addjob(name .. "_metafile", function(index, total)
local metafilepath = common.get_metafile(target, cppfile)
- depend.on_changed(function()
+ depend._on_changed(function()
progress.show(opt.progress, "${color.build.object}generating.module.metadata %s", name)
local metadata = common.generate_meta_module_info(target, name, cppfile, module.requires)
json.savefile(metafilepath, metadata)
- end, {dependfile = target:dependfile(metafilepath), files = {cppfile}})
+ end, {dependfile = target:dependfile(metafilepath), files = {cppfile}, changed = target:is_rebuilt()})
end, {rootjob = flushjob})
end
end
diff --git a/xmake/rules/c++/modules/modules_support/gcc.lua b/xmake/rules/c++/modules/modules_support/gcc.lua
index 206bf3c43..784df5d7e 100644
--- a/xmake/rules/c++/modules/modules_support/gcc.lua
+++ b/xmake/rules/c++/modules/modules_support/gcc.lua
@@ -184,7 +184,7 @@ function generate_dependencies(target, sourcebatch, opt)
local changed = false
for _, sourcefile in ipairs(sourcebatch.sourcefiles) do
local dependfile = target:dependfile(sourcefile)
- depend.on_changed(function()
+ depend._on_changed(function()
if opt.progress then
progress.show(opt.progress, "${color.build.object}generating.module.deps %s", sourcefile)
end
@@ -219,7 +219,7 @@ function generate_dependencies(target, sourcebatch, opt)
local dependinfo = io.readfile(jsonfile)
return { moduleinfo = dependinfo }
- end, {dependfile = dependfile, files = {sourcefile}})
+ end, {dependfile = dependfile, files = {sourcefile}, changed = target:is_rebuilt()})
end
return changed
end
@@ -237,7 +237,7 @@ function generate_stl_headerunits_for_batchjobs(target, batchjobs, headerunits,
local bmifile = path.join(stlcachedir, headerunit.name .. get_bmi_extension())
if not os.isfile(bmifile) then
batchjobs:addjob(headerunit.name, function (index, total)
- depend.on_changed(function()
+ depend._on_changed(function()
progress.show((index * 100) / total, "${color.build.object}compiling.headerunit.$(mode) %s", headerunit.name)
local args = {"-c", "-x", "c++-system-header", headerunit.name}
local flags = table.join(compinst:compflags({target = target}), args)
@@ -255,7 +255,7 @@ function generate_stl_headerunits_for_batchjobs(target, batchjobs, headerunits,
os.vrunv(compinst:program(), flags)
_add_module_to_mapper(mapper_file, headerunit.path, path.absolute(bmifile, projectdir))
os.tryrm(mapper_file_tmp)
- end, {dependfile = target:dependfile(bmifile), files = {headerunit.path}})
+ end, {dependfile = target:dependfile(bmifile), files = {headerunit.path}, changed = target:is_rebuilt()})
end, {rootjob = opt.rootjob})
else
_add_module_to_mapper(mapper_file, headerunit.path, path.absolute(bmifile, projectdir))
@@ -305,7 +305,7 @@ function generate_user_headerunits_for_batchjobs(target, batchjobs, headerunits,
local bmifilename = path.basename(objectfile) .. get_bmi_extension()
local bmifile = path.join(outputdir, bmifilename)
batchjobs:addjob(headerunit.name, function (index, total)
- depend.on_changed(function()
+ depend._on_changed(function()
progress.show((index * 100) / total, "${color.build.object}compiling.headerunit.$(mode) %s", headerunit.name)
local objectdir = path.directory(objectfile)
if not os.isdir(objectdir) then
@@ -331,7 +331,7 @@ function generate_user_headerunits_for_batchjobs(target, batchjobs, headerunits,
end
os.vrunv(compinst:program(), table.join(compinst:compflags({target = target}), args))
- end, {dependfile = target:dependfile(bmifile), files = {headerunit.path}})
+ end, {dependfile = target:dependfile(bmifile), files = {headerunit.path}, changed = target:is_rebuilt()})
end, {rootjob = opt.rootjob})
_add_module_to_mapper(mapper_file, headerunit_path, path.absolute(bmifile, projectdir))
end
@@ -417,11 +417,11 @@ function build_modules_for_batchjobs(target, batchjobs, objectfiles, modules, op
if fileconfig and fileconfig.install then
batchjobs:addjob(name .. "_metafile", function(index, total)
local metafilepath = common.get_metafile(target, cppfile)
- depend.on_changed(function()
+ depend._on_changed(function()
progress.show((index * 100) / total, "${color.build.object}generating.module.metadata %s", name)
local metadata = common.generate_meta_module_info(target, name, cppfile, module.requires)
json.savefile(metafilepath, metadata)
- end, {dependfile = target:dependfile(metafilepath), files = {cppfile}})
+ end, {dependfile = target:dependfile(metafilepath), files = {cppfile}, changed = target:is_rebuilt()})
end, {rootjob = opt.rootjob})
end
end
diff --git a/xmake/rules/c++/modules/modules_support/msvc.lua b/xmake/rules/c++/modules/modules_support/msvc.lua
index 3e7dce2ba..1cc881926 100644
--- a/xmake/rules/c++/modules/modules_support/msvc.lua
+++ b/xmake/rules/c++/modules/modules_support/msvc.lua
@@ -190,7 +190,7 @@ function generate_dependencies(target, sourcebatch, opt)
local changed = false
for _, sourcefile in ipairs(sourcebatch.sourcefiles) do
local dependfile = target:dependfile(sourcefile)
- depend.on_changed(function ()
+ depend._on_changed(function ()
if opt.progress then
progress.show(opt.progress, "${color.build.object}generating.module.deps %s", sourcefile)
end
@@ -216,7 +216,7 @@ function generate_dependencies(target, sourcebatch, opt)
local dependinfo = io.readfile(jsonfile)
return { moduleinfo = dependinfo }
- end, {dependfile = dependfile, files = {sourcefile}})
+ end, {dependfile = dependfile, files = {sourcefile}, changed = target:is_rebuilt()})
end
return changed
end
@@ -263,7 +263,7 @@ function generate_stl_headerunits_for_batchjobs(target, batchjobs, headerunits,
local bmifile = path.join(stlcachedir, headerunit.name .. get_bmi_extension())
local objectfile = bmifile .. ".obj"
batchjobs:addjob(headerunit.name, function(index, total)
- depend.on_changed(function()
+ depend._on_changed(function()
local flags = {
exportheaderflag,
headernameflag .. ":angle",
@@ -274,7 +274,7 @@ function generate_stl_headerunits_for_batchjobs(target, batchjobs, headerunits,
}
generate_headerunit_for_batchjob(target, headerunit.name, flags, objectfile, index, total)
- end, {dependfile = target:dependfile(bmifile), files = {headerunit.path}})
+ end, {dependfile = target:dependfile(bmifile), files = {headerunit.path}, changed = target:is_rebuilt()})
_add_module_to_mapper(target, headerunitflag .. ":angle", headerunit.name, headerunit.name, objectfile, bmifile)
end, {rootjob = flushjob})
end
@@ -332,7 +332,7 @@ function generate_user_headerunits_for_batchjobs(target, batchjobs, headerunits,
local bmifilename = path.basename(objectfile) .. get_bmi_extension()
local bmifile = path.join(outputdir, bmifilename)
batchjobs:addjob(headerunit.name, function (index, total)
- depend.on_changed(function()
+ depend._on_changed(function()
local objectdir = path.directory(objectfile)
if not os.isdir(objectdir) then
os.mkdir(objectdir)
@@ -351,7 +351,7 @@ function generate_user_headerunits_for_batchjobs(target, batchjobs, headerunits,
"/Fo" .. objectfile
}
generate_headerunit_for_batchjob(target, headerunit.name, flags, objectfile, index, total)
- end, {dependfile = target:dependfile(bmifile), files = {headerunit.path}})
+ end, {dependfile = target:dependfile(bmifile), files = {headerunit.path}, changed = target:is_rebuilt()})
_add_module_to_mapper(target, headerunitflag, headerunit.name, headerunit.path, objectfile, bmifile)
end, {rootjob = flushjob})
end
@@ -450,11 +450,11 @@ function build_modules_for_batchjobs(target, batchjobs, objectfiles, modules, op
if fileconfig and fileconfig.install then
batchjobs:addjob(name .. "_metafile", function(index, total)
local metafilepath = common.get_metafile(target, cppfile)
- depend.on_changed(function()
+ depend._on_changed(function()
progress.show((index * 100) / total, "${color.build.object}generating.module.metadata %s", name)
local metadata = common.generate_meta_module_info(target, name, cppfile, module.requires)
json.savefile(metafilepath, metadata)
- end, {dependfile = target:dependfile(metafilepath), files = {cppfile}})
+ end, {dependfile = target:dependfile(metafilepath), files = {cppfile}, changed = target:is_rebuilt()})
end, {rootjob = flushjob})
end
end
diff --git a/xmake/rules/c++/unity_build/unity_build.lua b/xmake/rules/c++/unity_build/unity_build.lua
index ad93753c0..84582c0c4 100644
--- a/xmake/rules/c++/unity_build/unity_build.lua
+++ b/xmake/rules/c++/unity_build/unity_build.lua
@@ -23,7 +23,7 @@ import("core.project.depend")
function _merge_unityfile(target, sourcefile_unity, sourcefiles, opt)
local dependfile = target:dependfile(sourcefile_unity)
- depend.on_changed(function ()
+ depend._on_changed(function ()
-- trace
vprint("generating.unityfile %s", sourcefile_unity)
@@ -45,7 +45,7 @@ function _merge_unityfile(target, sourcefile_unity, sourcefiles, opt)
end
unityfile:close()
- end, {dependfile = dependfile, files = sourcefiles})
+ end, {dependfile = dependfile, files = sourcefiles, changed = target:is_rebuilt()})
end
function generate_unityfiles(target, sourcebatch, opt)
diff --git a/xmake/rules/c51/xmake.lua b/xmake/rules/c51/xmake.lua
index da12b0922..0e4555753 100644
--- a/xmake/rules/c51/xmake.lua
+++ b/xmake/rules/c51/xmake.lua
@@ -35,9 +35,9 @@ rule("c51.binary")
import("core.project.depend")
import("lib.detect.find_tool")
import("utils.progress")
- depend.on_changed(function()
+ depend._on_changed(function()
local oh = assert(find_tool("oh51"), "oh51 not found")
os.iorunv(oh.program, {target:targetfile()})
progress.show(opt.progress, "${color.build.target}generating.$(mode) %s", target:targetfile() .. ".hex")
- end, {files = {target:targetfile()}})
+ end, {files = {target:targetfile()}, changed = target:is_rebuilt()})
end)
diff --git a/xmake/rules/cuda/devlink/devlink.lua b/xmake/rules/cuda/devlink/devlink.lua
index 50ef93597..3beb07f74 100644
--- a/xmake/rules/cuda/devlink/devlink.lua
+++ b/xmake/rules/cuda/devlink/devlink.lua
@@ -88,7 +88,7 @@ function main(target, opt)
end
local dryrun = option.get("dry-run")
local depvalues = {linkinst:program(), linkflags}
- depend.on_changed(function ()
+ depend._on_changed(function ()
-- is verbose?
local verbose = option.get("verbose")
@@ -107,5 +107,8 @@ 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, dryrun = dryrun})
+ end, {dependfile = target:dependfile(targetfile),
+ lastmtime = os.mtime(targetfile),
+ changed = target:is_rebuilt(),
+ values = depvalues, files = depfiles, dryrun = dryrun})
end
diff --git a/xmake/rules/platform/linux/driver/driver_modules.lua b/xmake/rules/platform/linux/driver/driver_modules.lua
index 67fbb8d22..d3e1a7d98 100644
--- a/xmake/rules/platform/linux/driver/driver_modules.lua
+++ b/xmake/rules/platform/linux/driver/driver_modules.lua
@@ -236,7 +236,7 @@ function link(target, opt)
local targetfile = target:targetfile()
local dependfile = target:dependfile(targetfile)
local objectfiles = target:objectfiles()
- depend.on_changed(function ()
+ depend._on_changed(function ()
-- trace
progress.show(opt.progress, "${color.build.object}linking.$(mode) %s", targetfile)
@@ -307,7 +307,7 @@ function link(target, opt)
os.mkdir(path.directory(targetfile))
os.vrunv(ld, argv)
- end, {dependfile = dependfile, lastmtime = os.mtime(target:targetfile()), files = objectfiles})
+ end, {dependfile = dependfile, lastmtime = os.mtime(target:targetfile()), files = objectfiles, changed = target:is_rebuilt()})
end
function install(target)
diff --git a/xmake/rules/protobuf/module_parser.lua b/xmake/rules/protobuf/module_parser.lua
index 163d36df2..d6d0486f7 100644
--- a/xmake/rules/protobuf/module_parser.lua
+++ b/xmake/rules/protobuf/module_parser.lua
@@ -36,7 +36,7 @@ end
-- generate module deps for the given file
function _generate_moduledeps(target, sourcefile, opt)
local dependfile = _get_dependfile_of_modulesource(target, sourcefile)
- depend.on_changed(function ()
+ depend._on_changed(function ()
-- trace
vprint("generating.proto.moduledeps %s", sourcefile)
@@ -70,7 +70,7 @@ function _generate_moduledeps(target, sourcefile, opt)
return dependinfo
end
- end, {dependfile = dependfile, files = {sourcefile}})
+ end, {dependfile = dependfile, files = {sourcefile}, changed = target:is_rebuilt()})
end
-- build batch jobs with deps
diff --git a/xmake/rules/utils/merge_archive/xmake.lua b/xmake/rules/utils/merge_archive/xmake.lua
index 39c913804..f8def1084 100644
--- a/xmake/rules/utils/merge_archive/xmake.lua
+++ b/xmake/rules/utils/merge_archive/xmake.lua
@@ -60,7 +60,7 @@ rule("utils.merge.archive")
if #libraryfiles > 0 then
table.insert(libraryfiles, target:targetfile())
end
- depend.on_changed(function ()
+ depend._on_changed(function ()
progress.show(opt.progress, "${color.build.target}merging.$(mode) %s", path.filename(target:targetfile()))
if #libraryfiles > 0 then
local tmpfile = os.tmpfile() .. path.extension(target:targetfile())
@@ -68,7 +68,7 @@ rule("utils.merge.archive")
os.cp(tmpfile, target:targetfile())
os.rm(tmpfile)
end
- end, {dependfile = target:dependfile(target:targetfile() .. ".merge_archive"), files = libraryfiles})
+ end, {dependfile = target:dependfile(target:targetfile() .. ".merge_archive"), files = libraryfiles, changed = target:is_rebuilt()})
end
end)
diff --git a/xmake/rules/utils/symbols/export_all/export_all.lua b/xmake/rules/utils/symbols/export_all/export_all.lua
index a9d264e50..18f3698db 100644
--- a/xmake/rules/utils/symbols/export_all/export_all.lua
+++ b/xmake/rules/utils/symbols/export_all/export_all.lua
@@ -27,7 +27,7 @@ import("core.project.depend")
import("utils.progress")
-- export all symbols for dynamic library
-function main (target, opt)
+function main(target, opt)
-- @note it only supports windows/dll now
assert(target:is_shared(), 'rule("utils.symbols.export_all"): only for shared target(%s)!', target:name())
@@ -38,7 +38,7 @@ function main (target, opt)
-- export all symbols
local allsymbols_filepath = path.join(target:autogendir(), "rules", "symbols", "export_all.def")
local dependfile = allsymbols_filepath .. ".d"
- depend.on_changed(function ()
+ depend._on_changed(function ()
-- trace progress info
progress.show(opt.progress, "${color.build.target}exporting.$(mode) %s", path.filename(target:targetfile()))
@@ -95,5 +95,5 @@ function main (target, opt)
wprint('rule("utils.symbols.export_all"): no symbols are exported for target(%s)!', target:name())
end
- end, {dependfile = dependfile, files = target:objectfiles()})
+ end, {dependfile = dependfile, files = target:objectfiles(), changed = target:is_rebuilt()})
end
diff --git a/xmake/rules/verilator/verilator.lua b/xmake/rules/verilator/verilator.lua
index 7800bae18..d601358af 100644
--- a/xmake/rules/verilator/verilator.lua
+++ b/xmake/rules/verilator/verilator.lua
@@ -215,7 +215,7 @@ function build_cppfiles(target, batchjobs, sourcebatch, opt)
local cmakefile = path.join(autogendir, targetname .. ".cmake")
-- build verilog files
- depend.on_changed(function()
+ depend._on_changed(function()
local argv = {"--cc", "--make", "cmake", "--prefix", targetname, "--Mdir", autogendir}
local flags = target:values("verilator.flags")
if flags then
@@ -241,6 +241,7 @@ function build_cppfiles(target, batchjobs, sourcebatch, opt)
end, {dependfile = cmakefile .. ".d",
files = sourcebatch.sourcefiles,
+ changed = target:is_rebuilt(),
lastmtime = os.mtime(cmakefile)})
-- get compiled source files
diff --git a/xmake/rules/xcode/application/build.lua b/xmake/rules/xcode/application/build.lua
index f65ad2855..a3cbf062f 100644
--- a/xmake/rules/xcode/application/build.lua
+++ b/xmake/rules/xcode/application/build.lua
@@ -35,7 +35,7 @@ function main (target, opt)
local frameworksdir = path.join(contentsdir, "Frameworks")
-- do build if changed
- depend.on_changed(function ()
+ depend._on_changed(function ()
-- trace progress info
progress.show(opt.progress, "${color.build.target}generating.xcode.$(mode) %s", path.filename(bundledir))
@@ -106,6 +106,6 @@ function main (target, opt)
end
codesign(bundledir, codesign_identity, mobile_provision, {deep = true})
- end, {dependfile = target:dependfile(bundledir), files = {bundledir, target:targetfile()}})
+ end, {dependfile = target:dependfile(bundledir), files = {bundledir, target:targetfile()}, changed = target:is_rebuilt()})
end
diff --git a/xmake/rules/xcode/bundle/xmake.lua b/xmake/rules/xcode/bundle/xmake.lua
index 9713e3b09..da78ec748 100644
--- a/xmake/rules/xcode/bundle/xmake.lua
+++ b/xmake/rules/xcode/bundle/xmake.lua
@@ -77,7 +77,7 @@ rule("xcode.bundle")
local resourcesdir = path.absolute(target:data("xcode.bundle.resourcesdir"))
-- do build if changed
- depend.on_changed(function ()
+ depend._on_changed(function ()
-- trace progress info
progress.show(opt.progress, "${color.build.target}generating.xcode.$(mode) %s", path.filename(bundledir))
@@ -109,7 +109,7 @@ rule("xcode.bundle")
end
codesign(bundledir, codesign_identity)
- end, {dependfile = target:dependfile(bundledir), files = {bundledir, target:targetfile()}})
+ end, {dependfile = target:dependfile(bundledir), files = {bundledir, target:targetfile()}, changed = target:is_rebuilt()})
end)
on_install(function (target)
diff --git a/xmake/rules/xcode/framework/xmake.lua b/xmake/rules/xcode/framework/xmake.lua
index 73370e4e2..81bd4ebc4 100644
--- a/xmake/rules/xcode/framework/xmake.lua
+++ b/xmake/rules/xcode/framework/xmake.lua
@@ -94,7 +94,7 @@ rule("xcode.framework")
local headersdir = path.join(contentsdir, "Headers")
-- do build if changed
- depend.on_changed(function ()
+ depend._on_changed(function ()
-- trace progress info
progress.show(opt.progress, "${color.build.target}generating.xcode.$(mode) %s", path.filename(bundledir))
@@ -162,7 +162,7 @@ rule("xcode.framework")
end
codesign(contentsdir, codesign_identity)
end
- end, {dependfile = target:dependfile(bundledir), files = {bundledir, target:targetfile()}})
+ end, {dependfile = target:dependfile(bundledir), files = {bundledir, target:targetfile()}, changed = target:is_rebuilt()})
end)
on_install(function (target)