summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2023-01-31 00:47:40 +0800
committerruki <[email protected]>2023-01-31 00:47:40 +0800
commit20596ffd79671904a2f990d870889ff81ed67a7a (patch)
tree5d5aea8169fe7f956d287d09ca13321b975cbf6e
parentc7b76a4dcc9f1938cef673b5a69a368adb7f8905 (diff)
fix dependfile in configfiles #3321
-rw-r--r--xmake/actions/config/configfiles.lua9
1 files changed, 8 insertions, 1 deletions
diff --git a/xmake/actions/config/configfiles.lua b/xmake/actions/config/configfiles.lua
index 990df730a..c6a135c25 100644
--- a/xmake/actions/config/configfiles.lua
+++ b/xmake/actions/config/configfiles.lua
@@ -30,7 +30,7 @@ import("lib.detect.find_tool")
-- get all configuration files
function _get_configfiles()
local configfiles = {}
- for _, target in pairs(project.targets()) do
+ for _, target in table.orderpairs(project.targets()) do
if target:is_enabled() then
-- get configuration files for target
@@ -56,6 +56,12 @@ function _get_configfiles()
srcinfo.fileinfo = fileinfo
end
+ -- we use first target to get dependfile path
+ -- @see https://github.com/xmake-io/xmake/issues/3321
+ if not srcinfo.dependfile then
+ srcinfo.dependfile = target:dependfile(srcfile)
+ end
+
-- save targets
srcinfo.targets = srcinfo.targets or {}
table.insert(srcinfo.targets, target)
@@ -317,6 +323,7 @@ function main(opt)
_generate_configfile(srcinfo.srcfile, dstfile, srcinfo.fileinfo, srcinfo.targets)
end, {files = srcinfo.srcfile,
lastmtime = os.mtime(dstfile),
+ dependfile = srcinfo.dependfile,
always_changed = opt.force})
end