From eba4c503ccaf873a87ec1f867ba3dffd98b45800 Mon Sep 17 00:00:00 2001 From: ruki Date: Wed, 26 Nov 2025 22:35:21 +0800 Subject: improve app/on_installcmd --- xmake/rules/xcode/application/installcmd.lua | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'xmake/rules/xcode/application/installcmd.lua') diff --git a/xmake/rules/xcode/application/installcmd.lua b/xmake/rules/xcode/application/installcmd.lua index 39d64ab1c..c08a0fede 100644 --- a/xmake/rules/xcode/application/installcmd.lua +++ b/xmake/rules/xcode/application/installcmd.lua @@ -22,11 +22,16 @@ function main(target, batchcmds, opt) local package = opt.package - -- only for macosx when packing dmg + -- only for macosx when packing if not target:is_plat("macosx") then return end + -- only for xpack (package exists) + if not package then + return + end + -- get app directory local appdir = target:data("xcode.bundle.rootdir") if not appdir or not os.isdir(appdir) then @@ -44,5 +49,22 @@ function main(target, batchcmds, opt) local appname = path.filename(appdir) local dstappdir = path.join(installdir, appname) batchcmds:cp(appdir, dstappdir, {symlink = true}) + + -- install target files (skip binary installation) + local srcfiles, dstfiles = target:installfiles(installdir) + if srcfiles and dstfiles then + for idx, srcfile in ipairs(srcfiles) do + batchcmds:cp(srcfile, dstfiles[idx], {symlink = true}) + end + end + -- install dependent target files + for _, dep in ipairs(target:orderdeps()) do + local srcfiles, dstfiles = dep:installfiles(installdir, {interface = true}) + if srcfiles and dstfiles then + for idx, srcfile in ipairs(srcfiles) do + batchcmds:cp(srcfile, dstfiles[idx], {symlink = true}) + end + end + end end -- cgit v1.3.1