diff --git a/xmake/modules/detect/tools/find_link.lua b/xmake/modules/detect/tools/find_link.lua index fedea7b6d45..c79b2e52a23 100644 --- a/xmake/modules/detect/tools/find_link.lua +++ b/xmake/modules/detect/tools/find_link.lua @@ -51,7 +51,8 @@ function main(opt) -- -- TODO maybe we can use ml to improve it else - local cl = assert(find_tool("cl", {envs = opt.envs})) + local is_clang_cl = toolchain and toolchain:name() == "clang-cl" + local cl = assert(find_tool(is_clang_cl and "clang-cl" or "cl", {envs = opt.envs})) -- make an stub source file local binaryfile = os.tmpfile() .. ".exe"