From 47165762ccd790fa920f1315ec6407d3067e51f5 Mon Sep 17 00:00:00 2001 From: star9029 Date: Wed, 1 Jan 2025 00:30:51 +0800 Subject: [PATCH] Fix cross compile with autotools on windows platform --- xmake/modules/package/tools/autoconf.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xmake/modules/package/tools/autoconf.lua b/xmake/modules/package/tools/autoconf.lua index 8c800c190e..4d2a404ed9 100644 --- a/xmake/modules/package/tools/autoconf.lua +++ b/xmake/modules/package/tools/autoconf.lua @@ -425,10 +425,12 @@ function buildenvs(package, opt) name = name:gsub("gcc%-", "g++-") envs.CXX = dir and path.join(dir, name) or name end - elseif package:is_plat("windows") and not package:config("toolchains") then + end + if package:is_plat("windows") and not package:config("toolchains") then envs.PATH = os.getenv("PATH") -- we need to reserve PATH on msys2 envs = os.joinenvs(envs, _get_msvc(package):runenvs()) end + if is_host("windows") then envs.CC = _translate_windows_bin_path(envs.CC) envs.AS = _translate_windows_bin_path(envs.AS)