Release build and packaging
This commit is contained in:
25
build.bat
25
build.bat
@@ -1,4 +1,12 @@
|
||||
@echo off
|
||||
setlocal enabledelayedexpansion
|
||||
cd /D "%~dp0"
|
||||
|
||||
for %%a in (%*) do set "%%~a=1"
|
||||
if not "%release%"=="1" set debug=1
|
||||
if "%debug%"=="1" set release=0 && echo [debug mode]
|
||||
if "%release%"=="1" set debug=0 && echo [release mode]
|
||||
if "%package%"=="1" echo [package zip]
|
||||
|
||||
if not exist "src\external\SDL" (
|
||||
pushd src\external
|
||||
@@ -7,21 +15,30 @@ if not exist "src\external\SDL" (
|
||||
git checkout release-3.4.0
|
||||
cmake -S . -B build_win32_static -DCMAKE_BUILD_TYPE=Release -DSDL_STATIC=ON
|
||||
pushd build_win32_static
|
||||
msbuild SDL3.sln
|
||||
msbuild SDL3.sln -maxCpuCount:16 -p:Configuration=Release
|
||||
popd
|
||||
popd
|
||||
popd
|
||||
)
|
||||
set sdl=..\src\external\SDL
|
||||
set sdllib=%sdl%\build_win32_static\Debug
|
||||
set sdllib=%sdl%\build_win32_static\Release
|
||||
|
||||
mkdir build
|
||||
pushd build
|
||||
|
||||
set flags=/EHsc- /MD /Zi /FC /nologo /WX /W3 /wd4200 /wd4334 /diagnostics:column -DDEBUG_BUILD=1
|
||||
set flags=/EHsc- /MT /Zi /FC /nologo /WX /W3 /wd4200 /wd4334 /diagnostics:column
|
||||
if "%release%"=="1" set flags=%flags% -O2 -DDEBUG_BUILD=0
|
||||
|
||||
set libs=%sdllib%/SDL3-static.lib %sdllib%/SDL_uclibc.lib kernel32.lib gdi32.lib user32.lib Imm32.lib ole32.lib Shell32.lib OleAut32.lib Cfgmgr32.lib Setupapi.lib Advapi32.lib version.lib winmm.lib
|
||||
cl %flags% ../src/text_editor/text_editor.cpp -Fe:te.exe -I%sdl%/include -I../src/external/glad -I../src/ %libs% -link /SUBSYSTEM:WINDOWS /NODEFAULTLIB:LIBCMT /NODEFAULTLIB:MSVCRTD
|
||||
|
||||
:: small util when working on the editor using the editor
|
||||
copy te.exe te2.exe
|
||||
|
||||
popd
|
||||
rem /fsanitize=address
|
||||
|
||||
if "%package%"=="1" (
|
||||
copy build\te.exe .
|
||||
"C:\Program Files\7-Zip\7z.exe" a te.zip te.exe
|
||||
del te.exe
|
||||
)
|
||||
Reference in New Issue
Block a user