aboutsummaryrefslogtreecommitdiff
path: root/examples/raylib_compile_execute.bat
diff options
context:
space:
mode:
authorRay <raysan5@gmail.com>2019-01-21 23:59:35 +0100
committerRay <raysan5@gmail.com>2019-01-21 23:59:35 +0100
commitdf407350671c787ec1906ee06467adc6becc0750 (patch)
treef1b00cf05db04947a9d72bc311c5ed9347302850 /examples/raylib_compile_execute.bat
parent4467292a2d5a5e0fbe2c3a28f8ffb1480c7b66ed (diff)
downloadraylib-df407350671c787ec1906ee06467adc6becc0750.tar.gz
raylib-df407350671c787ec1906ee06467adc6becc0750.zip
Added CMD compilation scripts for examples
They could be useful for some people...
Diffstat (limited to 'examples/raylib_compile_execute.bat')
-rw-r--r--examples/raylib_compile_execute.bat32
1 files changed, 32 insertions, 0 deletions
diff --git a/examples/raylib_compile_execute.bat b/examples/raylib_compile_execute.bat
new file mode 100644
index 00000000..aaae4056
--- /dev/null
+++ b/examples/raylib_compile_execute.bat
@@ -0,0 +1,32 @@
+::@echo off
+:: .
+:: Compile your examples using: raylib_compile_execute.bat core/core_basic_window.c
+:: .
+:: > Setup required Environment
+:: -------------------------------------
+set RAYLIB_INCLUDE_DIR=C:\GitHub\raylib\src
+set RAYLIB_LIB_DIR=C:\GitHub\raylib\src
+set RAYLIB_RES_FILE=C:\GitHub\raylib\raylib.rc.data
+set COMPILER_DIR=C:\raylib\mingw\bin
+set PATH=%PATH%;%COMPILER_DIR%
+:: Get full filename path for input file %1
+set FILENAME=%~f1
+set NAMEPART=%FILENAME:~0,-2%
+cd %~dp0
+:: .
+:: > Cleaning latest build
+:: ---------------------------
+cmd /c if exist %NAMEPART%.exe del /F %NAMEPART%.exe
+:: .
+:: > Compiling program
+:: --------------------------
+:: -s : Remove all symbol table and relocation information from the executable
+:: -O2 : Optimization Level 2, this option increases both compilation time and the performance of the generated code
+:: -std=c99 : Use C99 language standard
+:: -Wall : Enable all compilation Warnings
+:: -mwindows : Compile a Windows executable, no cmd window
+gcc -o %NAMEPART%.exe %FILENAME% %RAYLIB_RES_FILE% -s -O2 -I%RAYLIB_INCLUDE_DIR% -I%RAYLIB_LIB_DIR% -lraylib -lopengl32 -lgdi32 -std=c99 -Wall -mwindows
+:: .
+:: > Executing program
+:: -------------------------
+cmd /c if exist %NAMEPART%.exe %NAMEPART%.exe \ No newline at end of file