forked from matricks/bam
-
Notifications
You must be signed in to change notification settings - Fork 0
/
make_win64_msvc.bat
58 lines (50 loc) · 1.39 KB
/
make_win64_msvc.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
@echo off
@REM check if we already have the tools in the environment
if exist "%VCINSTALLDIR%" (
goto compile
)
@REM Check for Visual Studio
if defined VS110COMNTOOLS (
call set VSPATH=%%VS110COMNTOOLS%%
goto set_env
)
if defined VS100COMNTOOLS (
call set VSPATH=%%VS100COMNTOOLS%%
goto set_env
)
if defined VS90COMNTOOLS" (
call set VSPATH=%%VS90COMNTOOLS%%
goto set_env
)
if defined VS80COMNTOOLS (
call set VSPATH=%%VS80COMNTOOLS%%
goto set_env
)
echo You need Microsoft Visual Studio 8, 9, 10 or 11 installed
pause
exit
@ set up the environment
:set_env
if exist "%VSPATH%..\..\vc\vcvarsall.bat" (
call "%%VSPATH%%..\..\vc\vcvarsall.bat" amd64
goto compile
)
echo Unable to set up the environment
pause
exit
:compile
@echo === building bam ===
@cl /D_CRT_SECURE_NO_DEPRECATE /O2 /nologo src/tools/txt2c.c /Fesrc/tools/txt2c.exe
@src\tools\txt2c src/base.lua src/tools.lua src/driver_gcc.lua src/driver_clang.lua src/driver_cl.lua > src\internal_base.h
@REM /DLUA_BUILD_AS_DLL = export lua functions
@REM /W3 = Warning level 3
@REM /Ox = max optimizations
@REM /TC = compile as c
@REM /Zi = generate debug database
@REM /GS- = no stack checks
@REM /GL = Whole program optimization (ltcg)
@REM /LTCG = link time code generation
@cl /D_CRT_SECURE_NO_DEPRECATE /DLUA_BUILD_AS_DLL /W3 /O2 /TC /Zi /GS- /GL /nologo /I src/lua src/*.c src/lua/*.c /Febam.exe /link /LTCG
@REM clean up
@del bam.exp
@del *.obj