mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 15:14:08 +00:00
Windows/ARM64: Add MSVC cross-build support for x64 to ARM64.
Thanks to invertego. #1081
This commit is contained in:
parent
7a2b83a0c5
commit
e897c5743f
@ -214,6 +214,9 @@ msvcbuild
|
||||
Check the <tt>msvcbuild.bat</tt> file for more options.
|
||||
Then follow the installation instructions below.
|
||||
</p>
|
||||
<p>
|
||||
For an x64 to ARM64 cross-build run this first: <tt>vcvarsall.bat x64_arm64</tt>
|
||||
</p>
|
||||
<h3>Building with MinGW or Cygwin</h3>
|
||||
<p>
|
||||
Open a command prompt window and make sure the MinGW or Cygwin programs
|
||||
|
@ -27,12 +27,15 @@
|
||||
@set BUILDTYPE=release
|
||||
@set ALL_LIB=lib_base.c lib_math.c lib_bit.c lib_string.c lib_table.c lib_io.c lib_os.c lib_package.c lib_debug.c lib_jit.c lib_ffi.c lib_buffer.c
|
||||
|
||||
@setlocal
|
||||
@call :SETHOSTVARS
|
||||
%LJCOMPILE% host\minilua.c
|
||||
@if errorlevel 1 goto :BAD
|
||||
%LJLINK% /out:minilua.exe minilua.obj
|
||||
@if errorlevel 1 goto :BAD
|
||||
if exist minilua.exe.manifest^
|
||||
%LJMT% -manifest minilua.exe.manifest -outputresource:minilua.exe
|
||||
@endlocal
|
||||
|
||||
@set DASMFLAGS=-D WIN -D JIT -D FFI -D ENDIAN_LE -D FPU -D P64
|
||||
@set LJARCH=x64
|
||||
@ -46,6 +49,7 @@ if exist minilua.exe.manifest^
|
||||
:NO32
|
||||
@if "%VSCMD_ARG_TGT_ARCH%" neq "arm64" goto :X64
|
||||
@set DASC=vm_arm64.dasc
|
||||
@set DASMTARGET=-D LUAJIT_TARGET=LUAJIT_ARCH_ARM64
|
||||
@set LJARCH=arm64
|
||||
@goto :DA
|
||||
:X64
|
||||
@ -60,12 +64,15 @@ minilua %DASM% -LN %DASMFLAGS% -o host\buildvm_arch.h %DASC%
|
||||
if exist ..\.git ( git show -s --format=%%ct >luajit_relver.txt ) else ( type ..\.relver >luajit_relver.txt )
|
||||
minilua host\genversion.lua
|
||||
|
||||
%LJCOMPILE% /I "." /I %DASMDIR% host\buildvm*.c
|
||||
@setlocal
|
||||
@call :SETHOSTVARS
|
||||
%LJCOMPILE% /I "." /I %DASMDIR% %DASMTARGET% host\buildvm*.c
|
||||
@if errorlevel 1 goto :BAD
|
||||
%LJLINK% /out:buildvm.exe buildvm*.obj
|
||||
@if errorlevel 1 goto :BAD
|
||||
if exist buildvm.exe.manifest^
|
||||
%LJMT% -manifest buildvm.exe.manifest -outputresource:buildvm.exe
|
||||
@endlocal
|
||||
|
||||
buildvm -m peobj -o lj_vm.obj
|
||||
@if errorlevel 1 goto :BAD
|
||||
@ -124,6 +131,12 @@ if exist luajit.exe.manifest^
|
||||
@echo.
|
||||
@echo === Successfully built LuaJIT for Windows/%LJARCH% ===
|
||||
|
||||
@goto :END
|
||||
:SETHOSTVARS
|
||||
@if "%VSCMD_ARG_HOST_ARCH%_%VSCMD_ARG_TGT_ARCH%" equ "x64_arm64" (
|
||||
call "%VSINSTALLDIR%Common7\Tools\VsDevCmd.bat" -arch=%VSCMD_ARG_HOST_ARCH% -no_logo
|
||||
echo on
|
||||
)
|
||||
@goto :END
|
||||
:BAD
|
||||
@echo.
|
||||
|
Loading…
Reference in New Issue
Block a user