Skip to content

Commit

Permalink
make rpathdir clang function private
Browse files Browse the repository at this point in the history
  • Loading branch information
Arthapz committed Mar 7, 2024
1 parent 4f712db commit 252b7e5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions xmake/modules/core/tools/clang.lua
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ function _get_llvm_target_triple(self)
end

-- make the rpathdir flag
function rpathdir(self, dir)
function _rpathdir(self, dir)
dir = path.translate(dir)
if self:has_flags("-Wl,-rpath=" .. dir, "ldflags") then
local flags = {"-Wl,-rpath=" .. (dir:gsub("@[%w_]+", function (name)
Expand Down Expand Up @@ -309,13 +309,13 @@ function nf_runtime(self, runtime, opt)
maps["c++_shared"] = table.join(maps["c++_shared"], "-L" .. triple_libdir)
end
-- add rpath to avoid the user need to set LD_LIBRARY_PATH by hand
maps["c++_shared"] = table.join(maps["c++_shared"], rpathdir(self, libdir))
maps["c++_shared"] = table.join(maps["c++_shared"], _rpathdir(self, libdir))
if triple_libdir then
maps["c++_shared"] = table.join(maps["c++_shared"], rpathdir(self, triple_libdir))
maps["c++_shared"] = table.join(maps["c++_shared"], _rpathdir(self, triple_libdir))
end
if target:kind() == "shared" and self:is_plat("macosx", "iphoneos", "watchos") then
table.join2(maps["c++_shared"], "-install_name")
table.join2(maps["c++_shared"], "@rpath/" .. path.filename(target:filename()))
maps["c++_shared"] = table.join(maps["c++_shared"], "-install_name")
maps["c++_shared"] = table.join(maps["c++_shared"], "@rpath/" .. path.filename(target:filename()))
end
end
if runtime:endswith("_static") and _has_static_libstdcxx(self) then
Expand Down

0 comments on commit 252b7e5

Please sign in to comment.