diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/msvcbuild.bat | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/src/msvcbuild.bat b/src/msvcbuild.bat index bd0c4c5f..9db76275 100644 --- a/src/msvcbuild.bat +++ b/src/msvcbuild.bat | |||
@@ -1,19 +1,19 @@ | |||
1 | @rem Script to build LuaJIT with MSVC. | 1 | @rem Script to build LuaJIT with MSVC. |
2 | @rem Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h | 2 | @rem Copyright (C) 2005-2019 Mike Pall. See Copyright Notice in luajit.h |
3 | @rem | 3 | @rem |
4 | @rem Either open a "Visual Studio .NET Command Prompt" | 4 | @rem Open a "Visual Studio Command Prompt" (either x86 or x64). |
5 | @rem (Note that the Express Edition does not contain an x64 compiler) | 5 | @rem Then cd to this directory and run this script. Use the following |
6 | @rem -or- | 6 | @rem options (in order), if needed. The default is a dynamic release build. |
7 | @rem Open a "Windows SDK Command Shell" and set the compiler environment: | ||
8 | @rem setenv /release /x86 | ||
9 | @rem -or- | ||
10 | @rem setenv /release /x64 | ||
11 | @rem | 7 | @rem |
12 | @rem Then cd to this directory and run this script. | 8 | @rem debug emit debug symbols |
9 | @rem amalg amalgamated build | ||
10 | @rem static static linkage | ||
13 | 11 | ||
14 | @if not defined INCLUDE goto :FAIL | 12 | @if not defined INCLUDE goto :FAIL |
15 | 13 | ||
16 | @setlocal | 14 | @setlocal |
15 | @rem Add more debug flags here, e.g. DEBUGCFLAGS=/DLUA_USE_APICHECK | ||
16 | @set DEBUGCFLAGS= | ||
17 | @set LJCOMPILE=cl /nologo /c /O2 /W3 /D_CRT_SECURE_NO_DEPRECATE /D_CRT_STDIO_INLINE=__declspec(dllexport)__inline | 17 | @set LJCOMPILE=cl /nologo /c /O2 /W3 /D_CRT_SECURE_NO_DEPRECATE /D_CRT_STDIO_INLINE=__declspec(dllexport)__inline |
18 | @set LJLINK=link /nologo | 18 | @set LJLINK=link /nologo |
19 | @set LJMT=mt /nologo | 19 | @set LJMT=mt /nologo |
@@ -22,6 +22,7 @@ | |||
22 | @set DASM=%DASMDIR%\dynasm.lua | 22 | @set DASM=%DASMDIR%\dynasm.lua |
23 | @set LJDLLNAME=lua51.dll | 23 | @set LJDLLNAME=lua51.dll |
24 | @set LJLIBNAME=lua51.lib | 24 | @set LJLIBNAME=lua51.lib |
25 | @set BUILDTYPE=release | ||
25 | @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 | 26 | @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 |
26 | 27 | ||
27 | %LJCOMPILE% host\minilua.c | 28 | %LJCOMPILE% host\minilua.c |
@@ -65,9 +66,10 @@ buildvm -m folddef -o lj_folddef.h lj_opt_fold.c | |||
65 | 66 | ||
66 | @if "%1" neq "debug" goto :NODEBUG | 67 | @if "%1" neq "debug" goto :NODEBUG |
67 | @shift | 68 | @shift |
68 | @set LJCOMPILE=%LJCOMPILE% /Zi | 69 | @set BUILDTYPE=debug |
69 | @set LJLINK=%LJLINK% /debug | 70 | @set LJCOMPILE=%LJCOMPILE% /Zi %DEBUGCFLAGS% |
70 | :NODEBUG | 71 | :NODEBUG |
72 | @set LJLINK=%LJLINK% /%BUILDTYPE% | ||
71 | @if "%1"=="amalg" goto :AMALGDLL | 73 | @if "%1"=="amalg" goto :AMALGDLL |
72 | @if "%1"=="static" goto :STATIC | 74 | @if "%1"=="static" goto :STATIC |
73 | %LJCOMPILE% /MD /DLUA_BUILD_AS_DLL lj_*.c lib_*.c | 75 | %LJCOMPILE% /MD /DLUA_BUILD_AS_DLL lj_*.c lib_*.c |
@@ -111,5 +113,5 @@ if exist luajit.exe.manifest^ | |||
111 | @echo ******************************************************* | 113 | @echo ******************************************************* |
112 | @goto :END | 114 | @goto :END |
113 | :FAIL | 115 | :FAIL |
114 | @echo You must open a "Visual Studio .NET Command Prompt" to run this script | 116 | @echo You must open a "Visual Studio Command Prompt" to run this script |
115 | :END | 117 | :END |