summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Pall <mike>2019-12-08 18:52:41 +0100
committerMike Pall <mike>2019-12-08 18:52:41 +0100
commitc6c6e3b416635a528a711ed1986b054287a7c491 (patch)
tree729b2904e49fd1a9fc550ca27aed72c6bdf8b903 /src
parent3ece3a3e3a448ecc54e317fd5743d1f4c19db28b (diff)
downloadluajit2-c6c6e3b416635a528a711ed1986b054287a7c491.tar.gz
Update MSVC build script and docs.
Diffstat (limited to 'src')
-rw-r--r--src/msvcbuild.bat26
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 @@
@rem Script to build LuaJIT with MSVC.
-@rem Copyright (C) 2005-2017 Mike Pall. See Copyright Notice in luajit.h
+@rem Copyright (C) 2005-2019 Mike Pall. See Copyright Notice in luajit.h
@rem
-@rem Either open a "Visual Studio .NET Command Prompt"
-@rem (Note that the Express Edition does not contain an x64 compiler)
-@rem -or-
-@rem Open a "Windows SDK Command Shell" and set the compiler environment:
-@rem setenv /release /x86
-@rem -or-
-@rem setenv /release /x64
+@rem Open a "Visual Studio Command Prompt" (either x86 or x64).
+@rem Then cd to this directory and run this script. Use the following
+@rem options (in order), if needed. The default is a dynamic release build.
@rem
-@rem Then cd to this directory and run this script.
+@rem debug emit debug symbols
+@rem amalg amalgamated build
+@rem static static linkage
@if not defined INCLUDE goto :FAIL
@setlocal
+@rem Add more debug flags here, e.g. DEBUGCFLAGS=/DLUA_USE_APICHECK
+@set DEBUGCFLAGS=
@set LJCOMPILE=cl /nologo /c /O2 /W3 /D_CRT_SECURE_NO_DEPRECATE /D_CRT_STDIO_INLINE=__declspec(dllexport)__inline
@set LJLINK=link /nologo
@set LJMT=mt /nologo
@@ -22,6 +22,7 @@
@set DASM=%DASMDIR%\dynasm.lua
@set LJDLLNAME=lua51.dll
@set LJLIBNAME=lua51.lib
+@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
%LJCOMPILE% host\minilua.c
@@ -65,9 +66,10 @@ buildvm -m folddef -o lj_folddef.h lj_opt_fold.c
@if "%1" neq "debug" goto :NODEBUG
@shift
-@set LJCOMPILE=%LJCOMPILE% /Zi
-@set LJLINK=%LJLINK% /debug
+@set BUILDTYPE=debug
+@set LJCOMPILE=%LJCOMPILE% /Zi %DEBUGCFLAGS%
:NODEBUG
+@set LJLINK=%LJLINK% /%BUILDTYPE%
@if "%1"=="amalg" goto :AMALGDLL
@if "%1"=="static" goto :STATIC
%LJCOMPILE% /MD /DLUA_BUILD_AS_DLL lj_*.c lib_*.c
@@ -111,5 +113,5 @@ if exist luajit.exe.manifest^
@echo *******************************************************
@goto :END
:FAIL
-@echo You must open a "Visual Studio .NET Command Prompt" to run this script
+@echo You must open a "Visual Studio Command Prompt" to run this script
:END