mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 23:24:09 +00:00
Add debug option to msvcbuild.bat and improve error handling.
This commit is contained in:
parent
0af502f438
commit
8ccf89718c
@ -24,45 +24,77 @@
|
|||||||
|
|
||||||
if not exist buildvm_x86.h^
|
if not exist buildvm_x86.h^
|
||||||
%DASM% -LN -o buildvm_x86.h buildvm_x86.dasc
|
%DASM% -LN -o buildvm_x86.h buildvm_x86.dasc
|
||||||
|
@if errorlevel 1 goto :BAD
|
||||||
if not exist buildvm_x64win.h^
|
if not exist buildvm_x64win.h^
|
||||||
%DASM% -LN -D X64 -D X64WIN -o buildvm_x64win.h buildvm_x86.dasc
|
%DASM% -LN -D X64 -D X64WIN -o buildvm_x64win.h buildvm_x86.dasc
|
||||||
|
@if errorlevel 1 goto :BAD
|
||||||
|
|
||||||
%LJCOMPILE% /I "." /I %DASMDIR% buildvm*.c
|
%LJCOMPILE% /I "." /I %DASMDIR% buildvm*.c
|
||||||
|
@if errorlevel 1 goto :BAD
|
||||||
%LJLINK% /out:buildvm.exe buildvm*.obj
|
%LJLINK% /out:buildvm.exe buildvm*.obj
|
||||||
|
@if errorlevel 1 goto :BAD
|
||||||
if exist buildvm.exe.manifest^
|
if exist buildvm.exe.manifest^
|
||||||
%LJMT% -manifest buildvm.exe.manifest -outputresource:buildvm.exe
|
%LJMT% -manifest buildvm.exe.manifest -outputresource:buildvm.exe
|
||||||
|
|
||||||
buildvm -m peobj -o lj_vm.obj
|
buildvm -m peobj -o lj_vm.obj
|
||||||
|
@if errorlevel 1 goto :BAD
|
||||||
buildvm -m bcdef -o lj_bcdef.h %ALL_LIB%
|
buildvm -m bcdef -o lj_bcdef.h %ALL_LIB%
|
||||||
|
@if errorlevel 1 goto :BAD
|
||||||
buildvm -m ffdef -o lj_ffdef.h %ALL_LIB%
|
buildvm -m ffdef -o lj_ffdef.h %ALL_LIB%
|
||||||
|
@if errorlevel 1 goto :BAD
|
||||||
buildvm -m libdef -o lj_libdef.h %ALL_LIB%
|
buildvm -m libdef -o lj_libdef.h %ALL_LIB%
|
||||||
|
@if errorlevel 1 goto :BAD
|
||||||
buildvm -m recdef -o lj_recdef.h %ALL_LIB%
|
buildvm -m recdef -o lj_recdef.h %ALL_LIB%
|
||||||
|
@if errorlevel 1 goto :BAD
|
||||||
buildvm -m vmdef -o ..\lib\vmdef.lua %ALL_LIB%
|
buildvm -m vmdef -o ..\lib\vmdef.lua %ALL_LIB%
|
||||||
|
@if errorlevel 1 goto :BAD
|
||||||
buildvm -m folddef -o lj_folddef.h lj_opt_fold.c
|
buildvm -m folddef -o lj_folddef.h lj_opt_fold.c
|
||||||
|
@if errorlevel 1 goto :BAD
|
||||||
|
|
||||||
|
@if "%1" neq "debug" goto :NODEBUG
|
||||||
|
@shift
|
||||||
|
@set LJCOMPILE=%LJCOMPILE% /Zi /Fdluajit.pdb
|
||||||
|
@set LJLINK=%LJLINK% /debug /PDB:luajit.pdb
|
||||||
|
:NODEBUG
|
||||||
@if "%1"=="amalg" goto :AMALGDLL
|
@if "%1"=="amalg" goto :AMALGDLL
|
||||||
@if "%1"=="static" goto :STATIC
|
@if "%1"=="static" goto :STATIC
|
||||||
%LJCOMPILE% /DLUA_BUILD_AS_DLL lj_*.c lib_*.c
|
%LJCOMPILE% /DLUA_BUILD_AS_DLL lj_*.c lib_*.c
|
||||||
|
@if errorlevel 1 goto :BAD
|
||||||
%LJLINK% /DLL /out:lua51.dll lj_*.obj lib_*.obj
|
%LJLINK% /DLL /out:lua51.dll lj_*.obj lib_*.obj
|
||||||
|
@if errorlevel 1 goto :BAD
|
||||||
@goto :MTDLL
|
@goto :MTDLL
|
||||||
:STATIC
|
:STATIC
|
||||||
%LJCOMPILE% /DLUA_BUILD_AS_DLL lj_*.c lib_*.c
|
%LJCOMPILE% /DLUA_BUILD_AS_DLL lj_*.c lib_*.c
|
||||||
|
@if errorlevel 1 goto :BAD
|
||||||
%LJLIB% /OUT:lua51.lib lj_*.obj lib_*.obj
|
%LJLIB% /OUT:lua51.lib lj_*.obj lib_*.obj
|
||||||
|
@if errorlevel 1 goto :BAD
|
||||||
@goto :MTDLL
|
@goto :MTDLL
|
||||||
:AMALGDLL
|
:AMALGDLL
|
||||||
%LJCOMPILE% /DLUA_BUILD_AS_DLL ljamalg.c
|
%LJCOMPILE% /DLUA_BUILD_AS_DLL ljamalg.c
|
||||||
|
@if errorlevel 1 goto :BAD
|
||||||
%LJLINK% /DLL /out:lua51.dll ljamalg.obj lj_vm.obj
|
%LJLINK% /DLL /out:lua51.dll ljamalg.obj lj_vm.obj
|
||||||
|
@if errorlevel 1 goto :BAD
|
||||||
:MTDLL
|
:MTDLL
|
||||||
if exist lua51.dll.manifest^
|
if exist lua51.dll.manifest^
|
||||||
%LJMT% -manifest lua51.dll.manifest -outputresource:lua51.dll;2
|
%LJMT% -manifest lua51.dll.manifest -outputresource:lua51.dll;2
|
||||||
|
|
||||||
%LJCOMPILE% luajit.c
|
%LJCOMPILE% luajit.c
|
||||||
|
@if errorlevel 1 goto :BAD
|
||||||
%LJLINK% /out:luajit.exe luajit.obj lua51.lib
|
%LJLINK% /out:luajit.exe luajit.obj lua51.lib
|
||||||
|
@if errorlevel 1 goto :BAD
|
||||||
if exist luajit.exe.manifest^
|
if exist luajit.exe.manifest^
|
||||||
%LJMT% -manifest luajit.exe.manifest -outputresource:luajit.exe
|
%LJMT% -manifest luajit.exe.manifest -outputresource:luajit.exe
|
||||||
|
|
||||||
del *.obj *.manifest buildvm.exe
|
@del *.obj *.manifest buildvm.exe
|
||||||
|
@echo.
|
||||||
|
@echo === Successfully built LuaJIT ===
|
||||||
|
|
||||||
|
@goto :END
|
||||||
|
:BAD
|
||||||
|
@echo.
|
||||||
|
@echo *******************************************************
|
||||||
|
@echo *** Build FAILED -- Please check the error messages ***
|
||||||
|
@echo *******************************************************
|
||||||
@goto :END
|
@goto :END
|
||||||
:FAIL
|
:FAIL
|
||||||
@echo You must open a "Visual Studio .NET Command Prompt" to run this script
|
@echo You must open a "Visual Studio .NET Command Prompt" to run this script
|
||||||
|
Loading…
Reference in New Issue
Block a user