From 7c41b302ce315dde4ed031fa8ba5e406ea368b1a Mon Sep 17 00:00:00 2001 From: ruki Date: Sat, 18 Feb 2023 20:20:19 +0800 Subject: improve tools/meson --- xmake/modules/package/tools/meson.lua | 9 ++++++--- 1 file 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 -- cgit v1.3.1