forked from sakura-editor/sakura
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-gnu.bat
56 lines (50 loc) · 1.32 KB
/
build-gnu.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
@echo off
set platform=%1
set configuration=%2
if "%platform%" == "MinGW" (
@rem OK
) else (
call :showhelp %0
exit /b 1
)
if "%configuration%" == "Release" (
@rem OK
set MYDEFINES=-DNDEBUG
set MYCFLAGS=-O2
set MYLIBS=-s
) else if "%configuration%" == "Debug" (
@rem OK
set MYDEFINES=-D_DEBUG
set MYCFLAGS=-g -O0
set MYLIBS=
) else (
call :showhelp %0
exit /b 1
)
@rem https://www.appveyor.com/docs/environment-variables/
@rem path=C:\mingw-w64\x86_64-7.2.0-posix-seh-rt_v5-rev1\mingw64\bin;%path%
path=C:\msys64\mingw64\bin;%path%
@echo mingw32-make -C sakura_core MYDEFINES="%MYDEFINES%" MYCFLAGS="%MYCFLAGS%" MYLIBS="%MYLIBS%"
mingw32-make -C sakura_core MYDEFINES="%MYDEFINES%" MYCFLAGS="%MYCFLAGS%" MYLIBS="%MYLIBS%" -j4
if errorlevel 1 (
echo error 2 errorlevel %errorlevel%
exit /b 1
)
exit /b 0
@rem ------------------------------------------------------------------------------
@rem show help
@rem see http://orangeclover.hatenablog.com/entry/20101004/1286120668
@rem ------------------------------------------------------------------------------
:showhelp
@echo off
@echo usage
@echo %~nx1 platform configuration
@echo.
@echo parameter
@echo platform : MinGW
@echo configuration : Release or Debug
@echo.
@echo example
@echo %~nx1 MinGW Release
@echo %~nx1 MinGW Debug
exit /b 0