diff options
| author | ruki <[email protected]> | 2024-04-27 23:38:16 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-04-27 23:38:16 +0800 |
| commit | fd6bc85572e3c1811a8a7aa8f4c3c19089da7d50 (patch) | |
| tree | 2cc504dee222368371b73b7572c4f6f07f069b30 /xmake/core | |
| parent | fdde80e8bb645dad8ed82643ce09c79370c0f3fa (diff) | |
Update target.lua
Diffstat (limited to 'xmake/core')
| -rw-r--r-- | xmake/core/project/target.lua | 10 |
1 files 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 |
