build.bat
1.31 KB
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
@rem Script to compile T-Engine's webapi functionality.
@rem See copyright notice in web-te4.h.
@rem To use: load a windows SDK command prompt, navigate to source file root
@rem setenv /release /x86 /xp
@rem build\windows\build-te4-web.bat
@rem SDK tools to use (with options)
@rem TODO: offer a debugging build?
@if not defined INCLUDE goto :BADENV
@setlocal
@set CXX=cl
@set CXXFLAGS=/nologo /MT /O2 /W3 /D_CRT_SECURE_NO_DEPRECATE /EHsc /DSELFEXE_WINDOWS
@rem @set CXXFLAGS=/nologo /MT /Od /Zi /Wall /D_CRT_SECURE_NO_DEPRECATE /EHsc
@set SPAWNNAME=cef3spawn.exe
@set SPAWN_C=spawn.cpp
@set DLLNAME=te4-web.dll
@set LIBNAME=te4-web.lib
@set TE4_WEB_C=web.cpp web-utils.cpp
@set TE4_WEB_INCLUDES=/I ".." /I "C:\MingW\include\SDL2" /I "n:\libs\cef3\include" /I "n:\libs\cef3"
@set TE4_WEB_LIBS="n:\libs\cef3\Release\libcef.lib" "n:\libs\cef3\out\Release\lib\libcef_dll_wrapper.lib" "user32.lib"
%CXX% %CXXFLAGS% /LD /Fe%DLLNAME% %TE4_WEB_INCLUDES% %TE4_WEB_C% %TE4_WEB_LIBS%
%CXX% %CXXFLAGS% /Fe%SPAWNNAME% %TE4_WEB_INCLUDES% %SPAWN_C% %TE4_WEB_LIBS%
@if errorlevel 1 goto :COMPILATION_ERROR
@rem All done.
@echo Successfully built %DLLNAME%.
@goto :END
:COMPILATION_ERROR
@echo ERROR: Failed to build te4web. Check SDK tool output for errors.
@goto :END
:BAD_ENV
@echo ERROR: Must be compiled in a Windows SDK Command Prompt!
:END