From d860777fa4df424482cb63723d71ae894002584c Mon Sep 17 00:00:00 2001 From: ruki Date: Sat, 27 Jul 2024 00:35:55 +0800 Subject: [PATCH] improve rpath --- xmake/modules/core/tools/gcc.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xmake/modules/core/tools/gcc.lua b/xmake/modules/core/tools/gcc.lua index e33c40c418d..9500cbd3861 100644 --- a/xmake/modules/core/tools/gcc.lua +++ b/xmake/modules/core/tools/gcc.lua @@ -387,6 +387,10 @@ end -- make the rpathdir flag function nf_rpathdir(self, dir, opt) opt = opt or {} + local extra = opt.extra + if extra and extra.installonly then + return + end dir = path.translate(dir) if self:has_flags("-Wl,-rpath=" .. dir, "ldflags") then local flags = {"-Wl,-rpath=" .. (dir:gsub("@[%w_]+", function (name) @@ -395,7 +399,6 @@ function nf_rpathdir(self, dir, opt) end))} -- add_rpathdirs("...", {runpath = false}) -- https://github.com/xmake-io/xmake/issues/5109 - local extra = opt.extra if extra then if extra.runpath == false and self:has_flags("-Wl,-rpath=" .. dir .. ",--disable-new-dtags", "ldflags") then flags[1] = flags[1] .. ",--disable-new-dtags"