summaryrefslogtreecommitdiff
path: root/xmake/rules/xcode/framework/xmake.lua
diff options
context:
space:
mode:
authorruki <[email protected]>2022-09-20 22:35:20 +0800
committerruki <[email protected]>2022-09-20 22:35:20 +0800
commitaff68aac2686a411698b2f44c506fb227bed3d59 (patch)
tree7c42963eea538ec535b17d6e46644dff708a8ce4 /xmake/rules/xcode/framework/xmake.lua
parentb17aafa3ba887d41fb9dc067c401c5930bc3f79f (diff)
improve framework for ios #2765
Diffstat (limited to 'xmake/rules/xcode/framework/xmake.lua')
-rw-r--r--xmake/rules/xcode/framework/xmake.lua39
1 files changed, 21 insertions, 18 deletions
diff --git a/xmake/rules/xcode/framework/xmake.lua b/xmake/rules/xcode/framework/xmake.lua
index 6fffa8f46..643a278b8 100644
--- a/xmake/rules/xcode/framework/xmake.lua
+++ b/xmake/rules/xcode/framework/xmake.lua
@@ -33,8 +33,8 @@ rule("xcode.framework")
target:data_set("xcode.bundle.rootdir", bundledir)
-- get contents and resources directory
- local contentsdir = path.join(bundledir, "Versions", "A")
- local resourcesdir = path.join(bundledir, "Versions", "A", "Resources")
+ local contentsdir = target:is_plat("macosx") and path.join(bundledir, "Versions", "A") or bundledir
+ local resourcesdir = path.join(contentsdir, "Resources")
target:data_set("xcode.bundle.contentsdir", contentsdir)
target:data_set("xcode.bundle.resourcesdir", resourcesdir)
@@ -134,24 +134,27 @@ rule("xcode.framework")
end
-- link Versions/Current -> Versions/A
- local oldir = os.cd(path.join(bundledir, "Versions"))
- os.tryrm("Current")
- os.ln("A", "Current")
+ -- only for macos, @see https://github.com/xmake-io/xmake/issues/2765
+ if target:is_plat("macosx") then
+ local oldir = os.cd(path.join(bundledir, "Versions"))
+ os.tryrm("Current")
+ os.ln("A", "Current")
- -- link bundledir/* -> Versions/Current/*
- local target_filename = path.filename(target:targetfile())
- os.cd(bundledir)
- os.tryrm("Headers")
- os.tryrm("Resources")
- os.tryrm(target_filename)
- os.tryrm("Info.plist")
- os.ln("Versions/Current/Headers", "Headers")
- os.ln("Versions/Current/Resources", "Resources")
- if target:is_plat("iphoneos", "watchos") and os.isfile("Versions/Current/Resources/Info.plist") then
- os.ln("Versions/Current/Resources/Info.plist", "Info.plist")
+ -- link bundledir/* -> Versions/Current/*
+ local target_filename = path.filename(target:targetfile())
+ os.cd(bundledir)
+ os.tryrm("Headers")
+ os.tryrm("Resources")
+ os.tryrm(target_filename)
+ os.tryrm("Info.plist")
+ os.ln("Versions/Current/Headers", "Headers")
+ os.ln("Versions/Current/Resources", "Resources")
+ if target:is_plat("iphoneos", "watchos") and os.isfile("Versions/Current/Resources/Info.plist") then
+ os.ln("Versions/Current/Resources/Info.plist", "Info.plist")
+ end
+ os.ln(path.join("Versions/Current", target_filename), target_filename)
+ os.cd(oldir)
end
- os.ln(path.join("Versions/Current", target_filename), target_filename)
- os.cd(oldir)
-- do codesign, only for dynamic library
if target:kind() == "shared" then