diff options
| author | Andre Alves Garzia <andre@andregarzia.com> | 2019-12-31 01:34:59 +0000 |
|---|---|---|
| committer | Hisham Muhammad <hisham@gobolinux.org> | 2020-01-06 14:00:01 -0300 |
| commit | d2867542c34f1779be323c3e195216cd9301c9db (patch) | |
| tree | 145a07c1656c3ee9e0e46b7b398ee9062d24d0fd | |
| parent | 914b831271099e0f25cd9c1af66d354c5ee64ed2 (diff) | |
| download | luarocks-d2867542c34f1779be323c3e195216cd9301c9db.tar.gz luarocks-d2867542c34f1779be323c3e195216cd9301c9db.tar.bz2 luarocks-d2867542c34f1779be323c3e195216cd9301c9db.zip | |
install.bat: initial support for Windows on ARM
| -rw-r--r-- | install.bat | 14 |
1 files 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() | |||
| 415 | if not proc then | 415 | if not proc then |
| 416 | die("Could not detect processor architecture used in "..vars.LUA_INTERPRETER) | 416 | die("Could not detect processor architecture used in "..vars.LUA_INTERPRETER) |
| 417 | end | 417 | end |
| 418 | print("arch: " .. proc .. " -> " .. pe.const.Machine[proc]) | ||
| 418 | proc = pe.const.Machine[proc] -- collect name from constant value | 419 | proc = pe.const.Machine[proc] -- collect name from constant value |
| 419 | if proc == "IMAGE_FILE_MACHINE_I386" then | 420 | if proc == "IMAGE_FILE_MACHINE_I386" then |
| 420 | proc = "x86" | 421 | proc = "x86" |
| 422 | elseif proc == "IMAGE_FILE_MACHINE_ARM64" then | ||
| 423 | proc = "arm64" | ||
| 421 | else | 424 | else |
| 422 | proc = "x86_64" | 425 | proc = "x86_64" |
| 423 | end | 426 | end |
| @@ -554,8 +557,8 @@ local function get_msvc_env_setup_cmd() | |||
| 554 | if vsdir then | 557 | if vsdir then |
| 555 | local vcvarsall = vsdir .. '\\VC\\Auxiliary\\Build\\vcvarsall.bat' | 558 | local vcvarsall = vsdir .. '\\VC\\Auxiliary\\Build\\vcvarsall.bat' |
| 556 | if exists(vcvarsall) then | 559 | if exists(vcvarsall) then |
| 557 | local vcvarsall_args = { x86 = "", x86_64 = " x64" } | 560 | local vcvarsall_args = { x86 = "", x86_64 = " x64", arm64 = " x86_arm64" } |
| 558 | assert(vcvarsall_args[vars.UNAME_M], "vars.UNAME_M: only x86 and x86_64 are supported") | 561 | assert(vcvarsall_args[vars.UNAME_M], "vars.UNAME_M: only x86, x86_64 and arm64 are supported") |
| 559 | return ('call "%s"%s'):format(vcvarsall, vcvarsall_args[vars.UNAME_M]) | 562 | return ('call "%s"%s'):format(vcvarsall, vcvarsall_args[vars.UNAME_M]) |
| 560 | end | 563 | end |
| 561 | end | 564 | end |
| @@ -571,9 +574,12 @@ local function get_msvc_env_setup_cmd() | |||
| 571 | x86_64 = { | 574 | x86_64 = { |
| 572 | "bin\\amd64\\vcvars64.bat", -- prefers native compiler | 575 | "bin\\amd64\\vcvars64.bat", -- prefers native compiler |
| 573 | "bin\\x86_amd64\\vcvarsx86_amd64.bat" -- then cross compiler | 576 | "bin\\x86_amd64\\vcvarsx86_amd64.bat" -- then cross compiler |
| 577 | }, | ||
| 578 | arm64 = { | ||
| 579 | "bin\\x86_arm64\\vcvarsx86_arm64.bat" -- need to use cross compiler" | ||
| 574 | } | 580 | } |
| 575 | } | 581 | } |
| 576 | assert(vcvars_bats[vars.UNAME_M], "vars.UNAME_M: only x86 and x86_64 are supported") | 582 | assert(vcvars_bats[vars.UNAME_M], "vars.UNAME_M: only x86, arm64 and x86_64 are supported") |
| 577 | for _, bat in ipairs(vcvars_bats[vars.UNAME_M]) do | 583 | for _, bat in ipairs(vcvars_bats[vars.UNAME_M]) do |
| 578 | local full_path = vcdir .. bat | 584 | local full_path = vcdir .. bat |
| 579 | if exists(full_path) then | 585 | if exists(full_path) then |
| @@ -585,7 +591,7 @@ local function get_msvc_env_setup_cmd() | |||
| 585 | -- but this way we don't know if specified compiler is installed... | 591 | -- but this way we don't know if specified compiler is installed... |
| 586 | local vcvarsall = vcdir .. 'vcvarsall.bat' | 592 | local vcvarsall = vcdir .. 'vcvarsall.bat' |
| 587 | if exists(vcvarsall) then | 593 | if exists(vcvarsall) then |
| 588 | local vcvarsall_args = { x86 = "", x86_64 = " amd64" } | 594 | local vcvarsall_args = { x86 = "", x86_64 = " amd64", arm64 = " x86_arm64" } |
| 589 | return ('call "%s"%s'):format(vcvarsall, vcvarsall_args[vars.UNAME_M]) | 595 | return ('call "%s"%s'):format(vcvarsall, vcvarsall_args[vars.UNAME_M]) |
| 590 | end | 596 | end |
| 591 | end | 597 | end |
