2019-01-22 01:59:35 +03:00
|
|
|
::@echo off
|
|
|
|
:: .
|
|
|
|
:: Compile your examples using: raylib_compile_execute.bat core/core_basic_window.c
|
|
|
|
:: .
|
|
|
|
:: > Setup required Environment
|
|
|
|
:: -------------------------------------
|
2023-01-20 18:07:43 +03:00
|
|
|
set RAYLIB_INCLUDE_DIR=C:\raylib\raylib\src
|
|
|
|
set RAYLIB_LIB_DIR=C:\raylib\raylib\src
|
|
|
|
set RAYLIB_RES_FILE=C:\raylib\raylib\src\raylib.rc.data
|
|
|
|
set COMPILER_DIR=C:\raylib\w64devkit\bin
|
2019-01-22 01:59:35 +03:00
|
|
|
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
|
2021-12-03 17:39:46 +03:00
|
|
|
gcc -o %NAMEPART%.exe %FILENAME% %RAYLIB_RES_FILE% -s -O2 -I%RAYLIB_INCLUDE_DIR% -L%RAYLIB_LIB_DIR% -lraylib -lopengl32 -lgdi32 -lwinmm -std=c99 -Wall -mwindows
|
2019-01-22 01:59:35 +03:00
|
|
|
:: .
|
|
|
|
:: > Executing program
|
|
|
|
:: -------------------------
|
2021-12-03 17:39:46 +03:00
|
|
|
cmd /c if exist %NAMEPART%.exe %NAMEPART%.exe
|