diff options
| author | ruki <[email protected]> | 2022-08-22 23:18:17 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2022-08-22 23:18:17 +0800 |
| commit | 9aee5239d96e4682bc473bc819049549cb9ce006 (patch) | |
| tree | 14692e607b637039500a45781bac1c2deac98eca /xmake/rules/xcode/application/build.lua | |
| parent | 644a3172f67f2620896cbf77e155bdc1c07c2ff2 (diff) | |
improve frameworks
Diffstat (limited to 'xmake/rules/xcode/application/build.lua')
| -rw-r--r-- | xmake/rules/xcode/application/build.lua | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/xmake/rules/xcode/application/build.lua b/xmake/rules/xcode/application/build.lua index a4862ae86..3be9c0371 100644 --- a/xmake/rules/xcode/application/build.lua +++ b/xmake/rules/xcode/application/build.lua @@ -32,6 +32,7 @@ function main (target, opt) local bundledir = path.absolute(target:data("xcode.bundle.rootdir")) local contentsdir = path.absolute(target:data("xcode.bundle.contentsdir")) local resourcesdir = path.absolute(target:data("xcode.bundle.resourcesdir")) + local frameworksdir = path.join(contentsdir, "Frameworks") -- do build if changed depend.on_changed(function () @@ -46,10 +47,16 @@ function main (target, opt) end os.vcp(target:targetfile(), path.join(binarydir, path.filename(target:targetfile()))) - -- copy dependent dynamic libraries, TODO copy frameworks + -- copy dependent dynamic libraries and frameworks for _, dep in ipairs(target:orderdeps()) do if dep:kind() == "shared" then - os.vcp(dep:targetfile(), binarydir) + local frameworkdir = dep:data("xcode.bundle.rootdir") + if dep:rule("xcode.framework") and frameworkdir then + os.mkdir(frameworksdir) + os.vcp(frameworkdir, frameworksdir, {symlink = true}) + else + os.vcp(dep:targetfile(), binarydir) + end end end |
