diff options
Diffstat (limited to 'xmake/core/project/target.lua')
| -rw-r--r-- | xmake/core/project/target.lua | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/xmake/core/project/target.lua b/xmake/core/project/target.lua index cc5df14d4..e51ffeb8b 100644 --- a/xmake/core/project/target.lua +++ b/xmake/core/project/target.lua @@ -84,7 +84,7 @@ function _instance:_load_rule(ruleinst, suffix) if cache[key] == nil then local on_load = ruleinst:script("load" .. (suffix and ("_" .. suffix) or "")) if on_load then - local ok, errors = sandbox.load(on_load, self) + local ok, errors = sandbox.call(on_load, self) cache[key] = {ok, errors} else cache[key] = {true} @@ -129,7 +129,7 @@ function _instance:_load() -- do load for target local on_load = self:script("load") if on_load then - ok, errors = sandbox.load(on_load, self) + ok, errors = sandbox.call(on_load, self) if not ok then return false, errors end @@ -159,7 +159,7 @@ function _instance:_load_after() -- do load for target local after_load = self:script("load_after") if after_load then - local ok, errors = sandbox.load(after_load, self) + local ok, errors = sandbox.call(after_load, self) if not ok then return false, errors end @@ -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, .. |
