summaryrefslogtreecommitdiff
path: root/xmake/rules/xcode
diff options
context:
space:
mode:
authorruki <[email protected]>2022-08-23 00:45:23 +0800
committerruki <[email protected]>2022-08-23 00:45:23 +0800
commit22097d49e8a8ff60a8535005c3c3e5b713b2bd42 (patch)
tree9f9c1f65e08f44d11b6defddfa72858057e1dfeb /xmake/rules/xcode
parent9aee5239d96e4682bc473bc819049549cb9ce006 (diff)
improve to copy framework
Diffstat (limited to 'xmake/rules/xcode')
-rw-r--r--xmake/rules/xcode/application/build.lua18
1 files changed, 16 insertions, 2 deletions
diff --git a/xmake/rules/xcode/application/build.lua b/xmake/rules/xcode/application/build.lua
index 3be9c0371..fcc428b91 100644
--- a/xmake/rules/xcode/application/build.lua
+++ b/xmake/rules/xcode/application/build.lua
@@ -25,6 +25,21 @@ import("core.project.depend")
import("private.tools.codesign")
import("utils.progress")
+-- copy frameworks with symlink
+--
+-- TODO we should improve os.cp to support for copying directory with symlink
+-- os.vcp(frameworkdir, frameworksdir, {symlink = true})
+function _copy_frameworks(frameworkdir, frameworksdir)
+ os.mkdir(frameworksdir)
+ for _, filepath in ipairs(os.filedirs(path.join(frameworkdir, "*"))) do
+ if path.filename(filepath) == "Versions" then
+ _copy_frameworks(filepath, path.join(frameworksdir, "Versions"))
+ else
+ os.cp(filepath, path.join(frameworksdir, path.filename(filepath)), {symlink = true})
+ end
+ end
+end
+
-- main entry
function main (target, opt)
@@ -52,8 +67,7 @@ function main (target, opt)
if dep:kind() == "shared" then
local frameworkdir = dep:data("xcode.bundle.rootdir")
if dep:rule("xcode.framework") and frameworkdir then
- os.mkdir(frameworksdir)
- os.vcp(frameworkdir, frameworksdir, {symlink = true})
+ _copy_frameworks(frameworkdir, frameworksdir, {symlink = true})
else
os.vcp(dep:targetfile(), binarydir)
end