45 lines
1.5 KiB
Batchfile
Executable File
45 lines
1.5 KiB
Batchfile
Executable File
@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
|
|
git clone https://github.com/libsdl-org/SDL.git
|
|
pushd 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 -maxCpuCount:16 -p:Configuration=Release
|
|
popd
|
|
popd
|
|
popd
|
|
)
|
|
set sdl=..\src\external\SDL
|
|
set sdllib=%sdl%\build_win32_static\Release
|
|
|
|
mkdir build
|
|
pushd build
|
|
|
|
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
|
|
rem rc ..\data\icon.rc
|
|
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 ..\data\icon.res
|
|
|
|
:: small util when working on the editor using the editor
|
|
copy te.exe te2.exe
|
|
|
|
popd
|
|
|
|
if "%package%"=="1" (
|
|
copy build\te.exe .
|
|
"C:\Program Files\7-Zip\7z.exe" a te.zip te.exe
|
|
del te.exe
|
|
) |