From cfafccfa0bae60f83d27fdda1cb593da9aa0d309 Mon Sep 17 00:00:00 2001 From: ruki Date: Thu, 23 May 2024 00:48:17 +0800 Subject: improve moc #5124 --- xmake/rules/qt/moc/xmake.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xmake/rules/qt/moc/xmake.lua b/xmake/rules/qt/moc/xmake.lua index 623d3a6cb..d4272b688 100644 --- a/xmake/rules/qt/moc/xmake.lua +++ b/xmake/rules/qt/moc/xmake.lua @@ -23,8 +23,6 @@ rule("qt.moc") add_deps("qt.ui", {order = true}) set_extensions(".h", ".hpp") before_buildcmd_file(function (target, batchcmds, sourcefile, opt) - - -- imports import("core.tool.compiler") -- get moc @@ -109,13 +107,15 @@ rule("qt.moc") break end end + batchcmds:set_depmtime(os.mtime(sourcefile_moc)) + batchcmds:set_depcache(target:dependfile(sourcefile_moc)) else -- compile c++ source file for moc batchcmds:compile(sourcefile_moc, objectfile) + batchcmds:set_depmtime(os.mtime(objectfile)) + batchcmds:set_depcache(target:dependfile(objectfile)) end -- add deps batchcmds:add_depfiles(sourcefile) - batchcmds:set_depmtime(os.mtime(objectfile)) - batchcmds:set_depcache(target:dependfile(objectfile)) end) -- cgit v1.3.1