summaryrefslogtreecommitdiff
path: root/build.bat
diff options
context:
space:
mode:
Diffstat (limited to 'build.bat')
-rwxr-xr-xbuild.bat43
1 files changed, 34 insertions, 9 deletions
diff --git a/build.bat b/build.bat
index f325dd8..c2735c1 100755
--- a/build.bat
+++ b/build.bat
@@ -1,10 +1,35 @@
+@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 OUT_EXE=real2d
-@set INCLUDES=/I.. /Iimgui /I%SDL2_DIR%\include /IC:\lib\glew-2.1.0\include /I%FFMPEG_DIR%\include
-@set IMGUI_SOURCES=imgui\backends\imgui_impl_sdl.cpp imgui\backends\imgui_impl_opengl3.cpp imgui\imgui*.cpp
-@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 PREPROCESSORS=/DWINDOWS=1 /DARM=0 /DTHREADED=0
-cl /nologo /Zi /MD %PREPROCESSORS% %INCLUDES% main.cpp %IMGUI_SOURCES% /Febin/real2d.exe /Fobin/ /link %SDL_LIBS% %FFMPEG_LIBS% /subsystem:console
+
+set SDL2_DIR=C:\lib\SDL2-2.0.22
+set FFMPEG_DIR=C:\lib\ffmpeg-n5.0-latest-win64-lgpl-shared-5.0
+
+REM /Zi /O2
+set OPTIMIZATION=/Zi
+set DEBUG=1
+set IMGUI=0
+set THREADED=1
+set WINDOWS=1
+set ARM=0
+set PACKEDRGB=0
+set PERF=0
+
+set INCLUDES=/I.. /Iimgui /I%SDL2_DIR%\include /IC:\lib\glew-2.1.0\include /I%FFMPEG_DIR%\include /Ilib/glad/include
+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
+set WARNING_FLAGS=/W2 /wd4805 /wd4477 /wd4244 /wd4305
+
+if %DEBUG%==1 ( set PREPROCESSORS="/DDEBUG=1" )
+if %THREADED%==1 ( set PREPROCESSORS=%PREPROCESSORS% "/DTHREADED=1" )
+if %WINDOWS%==1 ( set PREPROCESSORS=%PREPROCESSORS% "/DWINDOWS=1" )
+if %ARM%==1 ( set PREPROCESSORS=%PREPROCESSORS% "/DARM=1" )
+if %PACKEDRGB%==1 ( set PREPROCESSORS=%PREPROCESSORS% "/DPACKEDRGB=1" )
+if %PERF%==1 ( set PREPROCESSORS=%PREPROCESSORS% "/DPERF=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 /Zi /MD %WARNING_FLAGS% %PREPROCESSORS% %INCLUDES% main.cpp bin/*.obj /Febin/real2d.exe /Fobin/ /link %SDL_LIBS% %FFMPEG_LIBS% /subsystem:console