summaryrefslogtreecommitdiff
path: root/xmake/rules/xcode/framework/xmake.lua
diff options
context:
space:
mode:
authorsunhw <[email protected]>2023-05-16 17:35:50 +0800
committersunhw <[email protected]>2023-05-16 17:56:27 +0800
commitf293842665adacc25b8f6556ac376e7aa08f40ce (patch)
tree13e1b3fe00ca288676fd6c779175a59da06e4681 /xmake/rules/xcode/framework/xmake.lua
parentc43704c299b8f7486ec5ca11be1b2e87dd5a6b08 (diff)
fix xcode.frameword can't build macos static-framework
Diffstat (limited to 'xmake/rules/xcode/framework/xmake.lua')
-rw-r--r--xmake/rules/xcode/framework/xmake.lua14
1 files changed, 8 insertions, 6 deletions
diff --git a/xmake/rules/xcode/framework/xmake.lua b/xmake/rules/xcode/framework/xmake.lua
index 7baae6412..73370e4e2 100644
--- a/xmake/rules/xcode/framework/xmake.lua
+++ b/xmake/rules/xcode/framework/xmake.lua
@@ -105,12 +105,14 @@ rule("xcode.framework")
end
os.vcp(target:targetfile(), contentsdir)
- -- change rpath
- -- @see https://github.com/xmake-io/xmake/issues/2679#issuecomment-1221839215
- local filename = path.filename(target:targetfile())
- local targetfile = path.join(contentsdir, filename)
- local rpath = path.relative(contentsdir, path.directory(bundledir))
- os.vrunv("install_name_tool", {"-id", path.join("@rpath", rpath, filename), targetfile})
+ if target:is_shared() then
+ -- change rpath
+ -- @see https://github.com/xmake-io/xmake/issues/2679#issuecomment-1221839215
+ local filename = path.filename(target:targetfile())
+ local targetfile = path.join(contentsdir, filename)
+ local rpath = path.relative(contentsdir, path.directory(bundledir))
+ os.vrunv("install_name_tool", {"-id", path.join("@rpath", rpath, filename), targetfile})
+ end
-- move header files
os.tryrm(headersdir)