diff options
| author | ruki <[email protected]> | 2026-08-16 13:17:24 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2026-08-16 13:17:24 +0800 |
| commit | d19c4eb75346bc6c658f191e3fdd3d796d21af09 (patch) | |
| tree | 3eb27abe92a87c3d91354a7e2f34a0f738db0459 | |
| parent | 65854acd5e7080dae4cac3e3b3ec1ce01e902ae7 (diff) | |
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, .. |
