diff options
| author | ruki <[email protected]> | 2023-05-16 21:27:54 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-05-16 21:27:54 +0800 |
| commit | 3bc9b2b0a6344201baf2ffa0662df23c03a8cdf2 (patch) | |
| tree | 13e1b3fe00ca288676fd6c779175a59da06e4681 | |
| parent | c43704c299b8f7486ec5ca11be1b2e87dd5a6b08 (diff) | |
| parent | f293842665adacc25b8f6556ac376e7aa08f40ce (diff) | |
Merge pull request #3750 from CaffreySun/dev
fix xcode.frameword can't build macos static-framework
| -rw-r--r-- | xmake/rules/xcode/framework/xmake.lua | 14 |
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) |
