From 27fc023a31d1472bdbdb9f4939415c5875b9481b Mon Sep 17 00:00:00 2001 From: jinke18 Date: Sat, 23 Nov 2024 12:23:18 +0800 Subject: [PATCH 1/2] add symlink support for installfiles when using xpack --- xmake/plugins/pack/batchcmds.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xmake/plugins/pack/batchcmds.lua b/xmake/plugins/pack/batchcmds.lua index 6b249b1a08..1fa0704c7e 100644 --- a/xmake/plugins/pack/batchcmds.lua +++ b/xmake/plugins/pack/batchcmds.lua @@ -183,14 +183,14 @@ function _install_target_files(target, batchcmds_, opt) local srcfiles, dstfiles = target:installfiles(_get_target_installdir(package, target)) if srcfiles and dstfiles then for idx, srcfile in ipairs(srcfiles) do - batchcmds_:cp(srcfile, dstfiles[idx]) + batchcmds_:cp(srcfile, dstfiles[idx], {symlink=true}) end end for _, dep in ipairs(target:orderdeps()) do local srcfiles, dstfiles = dep:installfiles(_get_target_installdir(package, dep), {interface = true}) if srcfiles and dstfiles then for idx, srcfile in ipairs(srcfiles) do - batchcmds_:cp(srcfile, dstfiles[idx]) + batchcmds_:cp(srcfile, dstfiles[idx], {symlink=true}) end end end @@ -564,7 +564,7 @@ end function _on_installcmd(package, batchcmds_) local srcfiles, dstfiles = package:installfiles() for idx, srcfile in ipairs(srcfiles) do - batchcmds_:cp(srcfile, dstfiles[idx]) + batchcmds_:cp(srcfile, dstfiles[idx], {symlink=true}) end for _, target in ipairs(package:targets()) do _get_target_installcmds(target, batchcmds_, {package = package}) From a14bc8f69e6a25905cea3c7ca72774cccf34e074 Mon Sep 17 00:00:00 2001 From: ruki Date: Sat, 23 Nov 2024 18:56:53 +0800 Subject: [PATCH 2/2] Update batchcmds.lua --- xmake/plugins/pack/batchcmds.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/xmake/plugins/pack/batchcmds.lua b/xmake/plugins/pack/batchcmds.lua index 1fa0704c7e..4174b907e6 100644 --- a/xmake/plugins/pack/batchcmds.lua +++ b/xmake/plugins/pack/batchcmds.lua @@ -183,14 +183,14 @@ function _install_target_files(target, batchcmds_, opt) local srcfiles, dstfiles = target:installfiles(_get_target_installdir(package, target)) if srcfiles and dstfiles then for idx, srcfile in ipairs(srcfiles) do - batchcmds_:cp(srcfile, dstfiles[idx], {symlink=true}) + batchcmds_:cp(srcfile, dstfiles[idx], {symlink = true}) end end for _, dep in ipairs(target:orderdeps()) do local srcfiles, dstfiles = dep:installfiles(_get_target_installdir(package, dep), {interface = true}) if srcfiles and dstfiles then for idx, srcfile in ipairs(srcfiles) do - batchcmds_:cp(srcfile, dstfiles[idx], {symlink=true}) + batchcmds_:cp(srcfile, dstfiles[idx], {symlink = true}) end end end @@ -564,7 +564,7 @@ end function _on_installcmd(package, batchcmds_) local srcfiles, dstfiles = package:installfiles() for idx, srcfile in ipairs(srcfiles) do - batchcmds_:cp(srcfile, dstfiles[idx], {symlink=true}) + batchcmds_:cp(srcfile, dstfiles[idx], {symlink = true}) end for _, target in ipairs(package:targets()) do _get_target_installcmds(target, batchcmds_, {package = package})