Skip to content

Commit

Permalink
MinGWビルドをappveyorに組み込む
Browse files Browse the repository at this point in the history
  • Loading branch information
berryzplus committed Sep 23, 2018
1 parent 359e69e commit 790b81e
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 1 deletion.
1 change: 1 addition & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ configuration:
platform:
- Win32
- x64
- MinGW

build_script:
- cmd: >-
Expand Down
12 changes: 11 additions & 1 deletion build-all.bat
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ if "%platform%" == "Win32" (
@rem OK
) else if "%platform%" == "x64" (
@rem OK
) else if "%platform%" == "MinGW" (
@rem OK
) else (
call :showhelp %0
exit /b 1
Expand All @@ -24,6 +26,12 @@ if "%configuration%" == "Release" (
@echo CONFIGURATION %CONFIGURATION%
@echo.

if "%platform%" == "MinGW" (
@echo call build-gnu.bat %PLATFORM% %CONFIGURATION%
call build-gnu.bat %PLATFORM% %CONFIGURATION% || (echo error build-gnu.bat && exit /b 1)
exit /b 0
)

@echo ---- start build-sln.bat ----
call build-sln.bat %PLATFORM% %CONFIGURATION% || (echo error build-sln.bat && exit /b 1)
@echo ---- end build-sln.bat ----
Expand Down Expand Up @@ -66,12 +74,14 @@ exit /b 0
@echo %~nx1 platform configuration
@echo.
@echo parameter
@echo platform : Win32 or x64
@echo platform : Win32 or x64 or MinGW
@echo configuration : Release or Debug
@echo.
@echo example
@echo %~nx1 Win32 Release
@echo %~nx1 Win32 Debug
@echo %~nx1 x64 Release
@echo %~nx1 x64 Release
@echo %~nx1 MinGW Release
@echo %~nx1 MinGW Debug
exit /b 0
56 changes: 56 additions & 0 deletions build-gnu.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,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/
path=C:\mingw-w64\x86_64-7.2.0-posix-seh-rt_v5-rev1\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%" githash stdafx Funccode_enum.h Funccode_define.h
if %errorlevel% neq 0 (popd && exit /b 1)

mingw32-make -C sakura_core MYDEFINES="%MYDEFINES%" MYCFLAGS="%MYCFLAGS%" MYLIBS="%MYLIBS%" -j4
if %errorlevel% neq 0 (popd && 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
5 changes: 5 additions & 0 deletions tests/build-and-test.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ set platform=%1
set configuration=%2
set ERROR_RESULT=0

if "%platform%" == "MinGW" (
@echo test for MinGW will be skipped. (platform: %platform%, configuration: %configuration%)
exit /b 0
)

@echo ---- start create-project.bat ----
call %~dp0create-project.bat %platform% %configuration%
if %ERRORLEVEL% neq 0 (
Expand Down

0 comments on commit 790b81e

Please sign in to comment.