Windows: Allow amalgamated static builds with msvcbuild.bat.

Reported by Naman Dixit. #1289
This commit is contained in:
Mike Pall 2024-11-14 17:21:00 +01:00
parent fca66335d1
commit fe71d0fb54

View File

@ -106,7 +106,7 @@ buildvm -m folddef -o lj_folddef.h lj_opt_fold.c
@if "%1"=="static" goto :STATIC @if "%1"=="static" goto :STATIC
%LJCOMPILE% %LJDYNBUILD% lj_*.c lib_*.c %LJCOMPILE% %LJDYNBUILD% lj_*.c lib_*.c
@if errorlevel 1 goto :BAD @if errorlevel 1 goto :BAD
%LJLINK% /DLL /out:%LJDLLNAME% lj_*.obj lib_*.obj %LJLINK% /DLL /OUT:%LJDLLNAME% lj_*.obj lib_*.obj
@if errorlevel 1 goto :BAD @if errorlevel 1 goto :BAD
@goto :MTDLL @goto :MTDLL
:STATIC :STATIC
@ -116,9 +116,16 @@ buildvm -m folddef -o lj_folddef.h lj_opt_fold.c
@if errorlevel 1 goto :BAD @if errorlevel 1 goto :BAD
@goto :MTDLL @goto :MTDLL
:AMALGDLL :AMALGDLL
@if "%2"=="static" goto :AMALGSTATIC
%LJCOMPILE% %LJDYNBUILD% ljamalg.c %LJCOMPILE% %LJDYNBUILD% ljamalg.c
@if errorlevel 1 goto :BAD @if errorlevel 1 goto :BAD
%LJLINK% /DLL /out:%LJDLLNAME% ljamalg.obj lj_vm.obj %LJLINK% /DLL /OUT:%LJDLLNAME% ljamalg.obj lj_vm.obj
@if errorlevel 1 goto :BAD
@goto :MTDLL
:AMALGSTATIC
%LJCOMPILE% ljamalg.c
@if errorlevel 1 goto :BAD
%LJLINK% /OUT:%LJDLLNAME% ljamalg.obj lj_vm.obj
@if errorlevel 1 goto :BAD @if errorlevel 1 goto :BAD
:MTDLL :MTDLL
if exist %LJDLLNAME%.manifest^ if exist %LJDLLNAME%.manifest^
@ -126,7 +133,7 @@ if exist %LJDLLNAME%.manifest^
%LJCOMPILE% luajit.c %LJCOMPILE% luajit.c
@if errorlevel 1 goto :BAD @if errorlevel 1 goto :BAD
%LJLINK% /out:luajit.exe luajit.obj %LJLIBNAME% %LJLINK% /OUT:luajit.exe luajit.obj %LJLIBNAME%
@if errorlevel 1 goto :BAD @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