From 9aee5239d96e4682bc473bc819049549cb9ce006 Mon Sep 17 00:00:00 2001 From: ruki Date: Mon, 22 Aug 2022 23:18:17 +0800 Subject: improve frameworks --- xmake/rules/xcode/application/build.lua | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'xmake/rules/xcode/application/build.lua') 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 -- cgit v1.3.1