diff options
| author | ruki <[email protected]> | 2026-08-16 20:15:54 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2026-08-16 20:15:54 +0800 |
| commit | c3debec81c555e5b39c81c4e39e1b9737041a650 (patch) | |
| tree | 29f550db819cfd72caf37047926ce18b94306b29 | |
| parent | 0093969683870de4cbce93b6cb5dafa55121f662 (diff) | |
| parent | d19c4eb75346bc6c658f191e3fdd3d796d21af09 (diff) | |
Merge pull request #7710 from xmake-io/vcpkg2
fix linkname
| -rw-r--r-- | xmake/core/project/target.lua | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/xmake/core/project/target.lua b/xmake/core/project/target.lua index 81b95cc96..e51ffeb8b 100644 --- a/xmake/core/project/target.lua +++ b/xmake/core/project/target.lua @@ -3296,6 +3296,14 @@ function target.linkname(filename, opt) linkname, count = filename:gsub(target.filename("__pattern__", "static", {plat = "windows"}):gsub("%.", "%%."):gsub("__pattern__", "(.+)") .. "$", "%1") end if count > 0 and linkname then + -- the library name itself may end with `.lib`, e.g. vcpkg installs `Luau.CLI.lib.lib`, + -- we cannot strip it, nf_link() passes the names ending with `.lib` to the linker + -- as-is, and it would look for `Luau.CLI.lib` + -- + -- @see https://github.com/xmake-io/xmake/issues/7708 + if opt.plat == "windows" and linkname:endswith(".lib") then + return filename + end return linkname end -- fallback to the generic unix library name, libxxx.a, libxxx.so, .. |
