summaryrefslogtreecommitdiff
path: root/build.bat
diff options
context:
space:
mode:
authortalha <talha@talhaamir.xyz>2024-03-12 03:55:58 +0500
committertalha <talha@talhaamir.xyz>2024-03-12 03:55:58 +0500
commit008997aa2107ae6940b2895b320f574adc85a114 (patch)
treeddf757fa9fb930115b4ed35cb8528ced978e1a8d /build.bat
Added project files to git
Diffstat (limited to 'build.bat')
-rw-r--r--build.bat24
1 files changed, 24 insertions, 0 deletions
diff --git a/build.bat b/build.bat
new file mode 100644
index 0000000..5b484b7
--- /dev/null
+++ b/build.bat
@@ -0,0 +1,24 @@
+@echo off
+REM Flags
+REM ***********Compiler Switches*****************
+REM -Zi => Produces Debug Information (.pdb files)
+REM ^__(can be problematic)
+REM -GR- => Disable runtime type info
+REM -EHa- => Disable exception handling
+REM -Oi => Enable compiler intrinsics
+REM -Od => (for learning) No Optimisation and leave everything as is
+REM -MT => Use the static library, package all the c
+REM runtime library into the executable
+REM ********************************************
+IF NOT EXIST w:\programming\sdl_base\build mkdir w:\programming\sdl_base\build
+pushd w:\programming\sdl_base\build
+set ProjectRoot=w:\programming\sdl_base
+set IncludePath=%ProjectRoot%\include
+set LibPath=%ProjectRoot%\libs
+set CommonIncludeFlags=/I"%IncludePath%"
+set CommonFileFlags=%IncludePath%\glad\glad.c
+set CommonLinkerFlags=-incremental:no %ProjectRoot%\libs\SDL2\SDL2.lib %ProjectRoot%\libs\SDL2\SDL2main.lib opengl32.lib shell32.lib
+set CommonCompilerFlags=-MT -nologo -Gm- -GR- -EHa- -Od -Oi -WX -W2 -wd4201 -wd4100 -wd4189 -FC -Z7
+
+cl %CommonCompilerFlags% %CommonIncludeFlags% %ProjectRoot%\main.c %CommonFileFlags% /link /LIBPATH:LibPath -subsystem:windows %CommonLinkerFlags%
+popd