From fd6bc85572e3c1811a8a7aa8f4c3c19089da7d50 Mon Sep 17 00:00:00 2001 From: ruki Date: Sat, 27 Apr 2024 23:38:16 +0800 Subject: Update target.lua --- xmake/core/project/target.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/xmake/core/project/target.lua b/xmake/core/project/target.lua index 9007bce67..9c396e25c 100644 --- a/xmake/core/project/target.lua +++ b/xmake/core/project/target.lua @@ -2850,13 +2850,13 @@ function target.linkname(filename, opt) if count == 0 and opt.plat == "mingw" then linkname, count = filename:gsub(target.filename("__pattern__", "static", {plat = "windows"}):gsub("%.", "%%."):gsub("__pattern__", "(.+)") .. "$", "%1") end + if count > 0 and linkname then + return linkname + end -- for custom shared libraries name, xxx.so, xxx.dylib - if count == 0 and not filename:startswith("lib") then - count = count + 1 - linkname = filename + if not filename:startswith("lib") and (filename:endswith(".so") or filename:endswith(".dylib")) then + return filename end - - return count > 0 and linkname or nil end -- new a target instance -- cgit v1.3.1