From d2867542c34f1779be323c3e195216cd9301c9db Mon Sep 17 00:00:00 2001 From: Andre Alves Garzia Date: Tue, 31 Dec 2019 01:34:59 +0000 Subject: install.bat: initial support for Windows on ARM --- install.bat | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/install.bat b/install.bat index f0305ab4..b92b9fd8 100644 --- a/install.bat +++ b/install.bat @@ -415,9 +415,12 @@ local function get_architecture() if not proc then die("Could not detect processor architecture used in "..vars.LUA_INTERPRETER) end + print("arch: " .. proc .. " -> " .. pe.const.Machine[proc]) proc = pe.const.Machine[proc] -- collect name from constant value if proc == "IMAGE_FILE_MACHINE_I386" then proc = "x86" + elseif proc == "IMAGE_FILE_MACHINE_ARM64" then + proc = "arm64" else proc = "x86_64" end @@ -554,8 +557,8 @@ local function get_msvc_env_setup_cmd() if vsdir then local vcvarsall = vsdir .. '\\VC\\Auxiliary\\Build\\vcvarsall.bat' if exists(vcvarsall) then - local vcvarsall_args = { x86 = "", x86_64 = " x64" } - assert(vcvarsall_args[vars.UNAME_M], "vars.UNAME_M: only x86 and x86_64 are supported") + local vcvarsall_args = { x86 = "", x86_64 = " x64", arm64 = " x86_arm64" } + assert(vcvarsall_args[vars.UNAME_M], "vars.UNAME_M: only x86, x86_64 and arm64 are supported") return ('call "%s"%s'):format(vcvarsall, vcvarsall_args[vars.UNAME_M]) end end @@ -571,9 +574,12 @@ local function get_msvc_env_setup_cmd() x86_64 = { "bin\\amd64\\vcvars64.bat", -- prefers native compiler "bin\\x86_amd64\\vcvarsx86_amd64.bat" -- then cross compiler + }, + arm64 = { + "bin\\x86_arm64\\vcvarsx86_arm64.bat" -- need to use cross compiler" } } - assert(vcvars_bats[vars.UNAME_M], "vars.UNAME_M: only x86 and x86_64 are supported") + assert(vcvars_bats[vars.UNAME_M], "vars.UNAME_M: only x86, arm64 and x86_64 are supported") for _, bat in ipairs(vcvars_bats[vars.UNAME_M]) do local full_path = vcdir .. bat if exists(full_path) then @@ -585,7 +591,7 @@ local function get_msvc_env_setup_cmd() -- but this way we don't know if specified compiler is installed... local vcvarsall = vcdir .. 'vcvarsall.bat' if exists(vcvarsall) then - local vcvarsall_args = { x86 = "", x86_64 = " amd64" } + local vcvarsall_args = { x86 = "", x86_64 = " amd64", arm64 = " x86_arm64" } return ('call "%s"%s'):format(vcvarsall, vcvarsall_args[vars.UNAME_M]) end end -- cgit v1.2.3-55-g6feb