diff options
| author | ruki <[email protected]> | 2022-08-31 22:45:05 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-08-31 22:45:05 +0800 |
| commit | ded1a93f8f9cdb86c38b37f97915f9452e822fa5 (patch) | |
| tree | 963c94c31e0c4943182cbfbbc4e763e47d45c6b9 /xmake/rules/xcode | |
| parent | 8294b15c930de7df43333dc1e93b019df93a73f8 (diff) | |
improve to install framework
Diffstat (limited to 'xmake/rules/xcode')
| -rw-r--r-- | xmake/rules/xcode/application/build.lua | 24 | ||||
| -rw-r--r-- | xmake/rules/xcode/framework/xmake.lua | 4 |
2 files changed, 5 insertions, 23 deletions
diff --git a/xmake/rules/xcode/application/build.lua b/xmake/rules/xcode/application/build.lua index 8089be966..fba9f319f 100644 --- a/xmake/rules/xcode/application/build.lua +++ b/xmake/rules/xcode/application/build.lua @@ -25,25 +25,6 @@ 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) - 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) - else - local dstpath = path.join(frameworkdir_dst, path.filename(filepath)) - os.tryrm(dstpath) - os.cp(filepath, dstpath, {symlink = true}) - end - end -end - -- main entry function main (target, opt) @@ -77,7 +58,10 @@ 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}) + if not os.isdir(frameworkdir) then + os.mkdir(frameworksdir) + end + os.cp(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 687b67208..6fffa8f46 100644 --- a/xmake/rules/xcode/framework/xmake.lua +++ b/xmake/rules/xcode/framework/xmake.lua @@ -172,9 +172,7 @@ rule("xcode.framework") if not os.isdir(installdir) then os.mkdir(installdir) end - -- TODO we should improve os.cp to support symlink - --os.vcp(bundledir, installdir, {symlink = true}) - appbuild.copy_frameworks(bundledir, installdir) + os.vcp(bundledir, installdir, {symlink = true}) end end) |
