summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2022-08-31 00:11:13 +0800
committerruki <[email protected]>2022-08-31 00:11:13 +0800
commit20e5768e36de8c12314c2dacd344cf18807c66f9 (patch)
tree88145f036994f9aaaf23dae0d38cdb8acf323948
parent7f94e5c1d69edcbf1b9b0338e015bfc5e5275883 (diff)
improve to install frameworks
-rw-r--r--xmake/rules/xcode/application/build.lua6
-rw-r--r--xmake/rules/xcode/framework/xmake.lua5
2 files changed, 7 insertions, 4 deletions
diff --git a/xmake/rules/xcode/application/build.lua b/xmake/rules/xcode/application/build.lua
index b39c3546e..8089be966 100644
--- a/xmake/rules/xcode/application/build.lua
+++ b/xmake/rules/xcode/application/build.lua
@@ -29,13 +29,13 @@ import("utils.progress")
--
-- TODO we should improve os.cp to support for copying directory with symlink
-- os.vcp(frameworkdir, frameworksdir, {symlink = true})
-function _copy_frameworks(frameworkdir, frameworksdir)
+function copy_frameworks(frameworkdir, frameworksdir)
os.mkdir(frameworksdir)
local frameworkdir_dst = path.join(frameworksdir, path.filename(frameworkdir))
os.tryrm(frameworkdir_dst)
for _, filepath in ipairs(os.filedirs(path.join(frameworkdir, "*"))) do
if path.filename(filepath) == "Versions" then
- _copy_frameworks(filepath, frameworkdir_dst)
+ copy_frameworks(filepath, frameworkdir_dst)
else
local dstpath = path.join(frameworkdir_dst, path.filename(filepath))
os.tryrm(dstpath)
@@ -77,7 +77,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
- _copy_frameworks(frameworkdir, frameworksdir, {symlink = true})
+ copy_frameworks(frameworkdir, frameworksdir, {symlink = true})
else
os.vcp(dep:targetfile(), binarydir)
end
diff --git a/xmake/rules/xcode/framework/xmake.lua b/xmake/rules/xcode/framework/xmake.lua
index 520ccf1b8..687b67208 100644
--- a/xmake/rules/xcode/framework/xmake.lua
+++ b/xmake/rules/xcode/framework/xmake.lua
@@ -165,13 +165,16 @@ rule("xcode.framework")
end)
on_install(function (target)
+ import("xcode.application.build", {alias = "appbuild", rootdir = path.join(os.programdir(), "rules")})
local bundledir = path.absolute(target:data("xcode.bundle.rootdir"))
local installdir = target:installdir()
if installdir then
if not os.isdir(installdir) then
os.mkdir(installdir)
end
- os.vcp(bundledir, installdir)
+ -- TODO we should improve os.cp to support symlink
+ --os.vcp(bundledir, installdir, {symlink = true})
+ appbuild.copy_frameworks(bundledir, installdir)
end
end)