diff options
| author | ruki <[email protected]> | 2021-09-16 00:31:02 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2021-09-16 00:31:02 +0800 |
| commit | 4cc9ef5e230ac3b765d26cdc3b0dd51ece2448e4 (patch) | |
| tree | 790fd7048c6f5eb18713ce41499719948b1f3fe3 /xmake/core/project | |
| parent | 43a72ecc3eba54b09dadcd0e8754dae7b23ed2da (diff) | |
improve mingw implib
Diffstat (limited to 'xmake/core/project')
| -rw-r--r-- | xmake/core/project/target.lua | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/xmake/core/project/target.lua b/xmake/core/project/target.lua index 8cfbf0a12..959e94f5b 100644 --- a/xmake/core/project/target.lua +++ b/xmake/core/project/target.lua @@ -2059,18 +2059,14 @@ end -- get the link name of the target file function target.linkname(filename) + -- for implib/mingw, e.g. libxxx.dll.a + if filename:startswith("lib") and filename:endswith(".dll.a") then + return filename:sub(4, #filename - 6) + end local linkname, count = filename:gsub(target.filename("__pattern__", "static"):gsub("%.", "%%."):gsub("__pattern__", "(.+)") .. "$", "%1") if count == 0 then linkname, count = filename:gsub(target.filename("__pattern__", "shared"):gsub("%.", "%%."):gsub("__pattern__", "(.+)") .. "$", "%1") end - if count == 0 then - -- for the mingw/cross platform, it is compatible with the libxxx.a and xxx.lib - local formats = {static = "lib$(name).a", shared = "lib$(name).so"} - linkname, count = filename:gsub(target.filename("__pattern__", "static", {format = formats["static"]}):gsub("%.", "%%."):gsub("__pattern__", "(.+)") .. "$", "%1") - if count == 0 then - linkname, count = filename:gsub(target.filename("__pattern__", "shared", {format = formats["shared"]}):gsub("%.", "%%."):gsub("__pattern__", "(.+)") .. "$", "%1") - end - end return count > 0 and linkname or nil end |
