-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
build-win32.ps1
32 lines (27 loc) · 1010 Bytes
/
build-win32.ps1
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
git fetch --all --tags
$VERSION_TAG = git describe --always --tags --abbrev=0
$COMMIT_HASH = git rev-parse --short HEAD
$OS_INFO = (Get-WMIObject win32_operatingsystem).caption + " " + `
(Get-WMIObject win32_operatingsystem).version + " " + `
(Get-WMIObject win32_operatingsystem).OSArchitecture
$SDL2_DIR = "SDL2-2.30.3\i686-w64-mingw32"
$PSX_DIR = "."
mkdir -Force -Path bin > $null
gcc -I"$($PSX_DIR)" `
-I"$($PSX_DIR)\psx" `
-I"$($SDL2_DIR)\include\SDL2" `
"psx\*.c" `
"psx\dev\*.c" `
"psx\input\*.c" `
"psx\disc\*.c" `
"frontend\*.c" `
-o "bin\psxe.exe" `
-DREP_VERSION="`"$($VERSION_TAG)`"" `
-DREP_COMMIT_HASH="`"$($COMMIT_HASH)`"" `
-DOS_INFO="`"$($OS_INFO)`"" `
-L"$($SDL2_DIR)\lib" `
-lSDL2main -lSDL2 -Wno-overflow `
-Wall -pedantic -DLOG_USE_COLOR `
-Wno-address-of-packed-member `
-ffast-math -Ofast -g -flto
Copy-Item -Path "$($SDL2_DIR)\bin\SDL2.dll" -Destination "bin"