summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmake/modules/package/tools/meson.lua9
1 files changed, 6 insertions, 3 deletions
diff --git a/xmake/modules/package/tools/meson.lua b/xmake/modules/package/tools/meson.lua
index 102cdf6b9..17d203f02 100644
--- a/xmake/modules/package/tools/meson.lua
+++ b/xmake/modules/package/tools/meson.lua
@@ -81,9 +81,12 @@ function _get_cross_file(package, opt)
if ld then
file:print("ld=['%s']", executable_path(ld))
end
- local ar = package:build_getenv("ar")
- if ar then
- file:print("ar=['%s']", executable_path(ar))
+ -- we cannot pass link.exe to ar for msvc, it will raise `unknown linker`
+ if not package:is_plat("windows") then
+ local ar = package:build_getenv("ar")
+ if ar then
+ file:print("ar=['%s']", executable_path(ar))
+ end
end
local strip = package:build_getenv("strip")
if strip then