forked from maihd/lite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_mingw.bat
34 lines (27 loc) · 879 Bytes
/
build_mingw.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
@echo off
:: download this:
:: https://www.msys2.org/
:: and install it to C:\msys64
:: then run this:
:: C:\msys64\mingw64.exe
:: and install clang:
:: pacman -S mingw-w64-x86_64-clang
echo > Compiling (windows - mingw - x64)...
set CC=C:\msys64\mingw64\bin\clang.exe
@REM set CC=gcc.exe
:: Libs for SDL (uncomment to use)
set PLATFORM_LIBS=-Ilibs/SDL2-2.0.10/x86_64-w64-mingw32/include -DLITE_SYSTEM_SDL2 -lSDL2main -lSDL2 -Llibs/SDL2-2.0.10/x86_64-w64-mingw32/lib
:: Libs for Win32 (uncomment to use)
@REM set PLATFORM_LIBS=
windres res/res.rc -O coff -o res.res
%CC% src/*.c src/api/*.c src/lib/stb/*.c ^
-O3 -std=c11 -fno-strict-aliasing ^
-DNDEBUG=1^
-Isrc -DLUA_USE_POPEN ^
%PLATFORM_LIBS%^
-Ilibs/luajit_2.1.0-beta3/src^
-lluajit_mingw -Llibs/luajit_2.1.0-beta3/prebuilt/x64^
-mwindows res.res^
-o lite.exe
:done
echo > Build done!