From 1a870edea963e755c2e0b6983f0c0c1395ad06e7 Mon Sep 17 00:00:00 2001 From: ruki Date: Tue, 23 Aug 2022 00:55:41 +0800 Subject: improve rpath for framework --- xmake/rules/xcode/framework/xmake.lua | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'xmake/rules/xcode/framework/xmake.lua') diff --git a/xmake/rules/xcode/framework/xmake.lua b/xmake/rules/xcode/framework/xmake.lua index de7d7c93c..438cbe00d 100644 --- a/xmake/rules/xcode/framework/xmake.lua +++ b/xmake/rules/xcode/framework/xmake.lua @@ -105,6 +105,12 @@ rule("xcode.framework") end os.vcp(target:targetfile(), contentsdir) + -- change rpath + 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), targetfile}) + -- move header files os.tryrm(headersdir) os.mv(path.join(contentsdir, "Headers.tmp", target:basename()), headersdir) -- cgit v1.3.1