summaryrefslogtreecommitdiff
path: root/build.bat
diff options
context:
space:
mode:
Diffstat (limited to 'build.bat')
-rwxr-xr-xbuild.bat28
1 files changed, 13 insertions, 15 deletions
diff --git a/build.bat b/build.bat
index 7f644ee..00451d6 100755
--- a/build.bat
+++ b/build.bat
@@ -1,22 +1,21 @@
@echo off
-REM call "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" x64
-set SDL2_DIR=C:\lib\SDL2-2.0.22
-set FFMPEG_DIR=C:\lib\ffmpeg-n5.0-latest-win64-lgpl-shared-5.0
+set STATIC=1
+set LIB_FILES=dependencies/bin/*
REM /Zi /O2
set OPTIMIZATION=/O2
set DEBUG=0
-set IMGUI=1
+set IMGUI=0
set ARM=0
set PERF=0
set STABLE=0
-REM /I%FFMPEG_DIR%\include
-set INCLUDES=/I.. /Iimgui /I%SDL2_DIR%\include /IC:\lib\glew-2.1.0\include /Ilib/glad/include /Icurl
-set SDL_LIBS=/LIBPATH:%SDL2_DIR%\lib\x64 SDL2.lib SDL2main.lib opengl32.lib shell32.lib
-set FFMPEG_LIBS=/LIBPATH:%FFMPEG_DIR%\lib avcodec.lib avfilter.lib avformat.lib swscale.lib avutil.lib
-set IMGUI_FILES=imgui\backends\imgui_impl_sdl.cpp imgui\backends\imgui_impl_opengl3.cpp imgui\imgui*.cpp
+if %STATIC%==1 ( set STATIC_LIB_NAMES=version.lib ole32.lib oleaut32.lib advapi32.lib setupapi.lib imm32.lib gdi32.lib winmm.lib user32.lib shell32.lib kernel32.lib shell32.lib bcrypt.lib )
+
+REM what did we need glew for again? /Icurl
+set INCLUDES=/I.. /Isrc /Isrc/include /Idependencies/include /Idependencies/src /Ilib/glad/include /Idependencies/include/SDL
+set IMGUI_FILES=dependencies\src\imgui\imgui_impl_sdl.cpp dependencies\src\imgui\imgui_impl_opengl3.cpp dependencies\src\imgui\imgui*.cpp
set WARNING_FLAGS=/W2 /wd4805 /wd4477 /wd4244 /wd4305
set PREPROCESSORS="/DWINDOWS=1"
@@ -24,10 +23,9 @@ if %DEBUG%==1 ( set PREPROCESSORS=%PREPROCESSORS% "/DDEBUG=1" )
if %PERF%==1 ( set PREPROCESSORS=%PREPROCESSORS% "/DPERF=1" )
if %STABLE%==1 ( set PREPROCESSORS=%PREPROCESSORS% "/DSTABLE=1" )
-cl /nologo %OPTIMIZATION% /MD /I.. /Iimgui /I%SDL2_DIR%\include my_imgui_internal_widgets.cpp /Fobin/ /c
-if %IMGUI%==1 ( cl /nologo %OPTIMIZATION% /MD /I.. /Iimgui /I%SDL2_DIR%\include %IMGUI_FILES% /Fobin/ /c )
-
-cl /nologo %OPTIMIZATION% /MD /I.. /Ilib/glad/include lib/glad.c /Fobin/ /c
+cl /nologo %OPTIMIZATION% /MD /Isrc/include /Idependencies/include src/imgui_helper_internal.cpp /Fobin/ /c
+if %IMGUI%==1 ( cl /nologo %OPTIMIZATION% /MD /Idependencies/include /Idependencies/include/SDL %IMGUI_FILES% /Fobin/ /c )
+cl /nologo %OPTIMIZATION% /MD /I.. /Idependencies/include dependencies/src/glad.c /Fobin/ /c
+cl /c /nologo /Zi /MT %WARNING_FLAGS% %PREPROCESSORS% %INCLUDES% src/main.cpp /Fobin/
-REM /link %SDL_LIBS% %FFMPEG_LIBS%
-cl /nologo /Zi /MD %WARNING_FLAGS% %PREPROCESSORS% %INCLUDES% main.cpp bin/*.obj /Febin/real2d.exe /Fobin/ /link %SDL_LIBS% /subsystem:console
+link /nologo bin/*.obj %LIB_FILES% %STATIC_LIB_NAMES% /OUT:bin/real2d.exe /subsystem:console