From fdde80e8bb645dad8ed82643ce09c79370c0f3fa Mon Sep 17 00:00:00 2001 From: kaoru Date: Sat, 27 Apr 2024 23:09:58 +0800 Subject: linkname assignment logic fixed --- xmake/core/project/target.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/xmake/core/project/target.lua b/xmake/core/project/target.lua index c5cf3a2b1..9007bce67 100644 --- a/xmake/core/project/target.lua +++ b/xmake/core/project/target.lua @@ -2851,8 +2851,9 @@ function target.linkname(filename, opt) linkname, count = filename:gsub(target.filename("__pattern__", "static", {plat = "windows"}):gsub("%.", "%%."):gsub("__pattern__", "(.+)") .. "$", "%1") end -- for custom shared libraries name, xxx.so, xxx.dylib - if filename:endswith(".so") or filename:endswith(".dylib") then - return filename; + if count == 0 and not filename:startswith("lib") then + count = count + 1 + linkname = filename end return count > 0 and linkname or nil -- cgit v1.3.1