diff options
| author | kaoru <[email protected]> | 2024-04-27 15:03:19 +0800 |
|---|---|---|
| committer | kaoru <[email protected]> | 2024-04-27 15:04:53 +0800 |
| commit | 835f9195e1c528f2644b9ddd0f6b9c6def710f44 (patch) | |
| tree | af2d41b5af537105439fc0c1c2277a8438871d56 | |
| parent | d65e144a3f8c3f48d7db30bea1482c4b39acd7a1 (diff) | |
Supports conversion of custom library link names
| -rw-r--r-- | xmake/core/project/target.lua | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/xmake/core/project/target.lua b/xmake/core/project/target.lua index fb48df6f8..32cbe0748 100644 --- a/xmake/core/project/target.lua +++ b/xmake/core/project/target.lua @@ -2833,6 +2833,7 @@ end -- get the link name of the target file function target.linkname(filename, opt) + print(filename, opt) -- for implib/mingw, e.g. libxxx.dll.a opt = opt or {} if filename:startswith("lib") and filename:endswith(".dll.a") then @@ -2850,6 +2851,11 @@ 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 + -- for custom shared libraries name, xxx.so, xxx.dylib + if filename:endswith(".so") or filename:endswith(".dylib") then + return filename; + end + return count > 0 and linkname or nil end |
