Build samples/tetris on Windows (#629)

This commit is contained in:
Mike Sinkovsky
2017-06-02 18:19:52 +05:00
committed by Nikolay Igotti
parent dd81d529ee
commit 1faaed5303
2 changed files with 25 additions and 1 deletions
+11 -1
View File
@@ -10,11 +10,19 @@ using binary distribution).
Install SDL2 development files (see https://www.libsdl.org/download-2.0.php). For Mac -
copy `SDL2.framework` to `$HOME/Library/Frameworks`. For Debian-like Linux -
use `apt-get install libsdl2-dev`.
For Windows - `pacman -S mingw-w64-x86_64-SDL2` in MinGW64 console, if you do
not have MSYS2-MinGW64 installed - install it first as described in http://www.msys2.org
To build Tetris application for your host platform use
For Mac and Linux:
./build.sh
For Windows:
build.bat
You also may use gradle to build this sample: `../gradlew build`. This task builds the sample for all platforms
supported by the host. Note that SDL2 must be installed on the host.
@@ -34,3 +42,5 @@ To deploy executable to iPhone device take Info.plist, then use XCode and your o
To run on Raspberry Pi one need to install SDL package with `apt-get install libsdl2-2.0.0` on the Pi.
Also GLES2 renderer is recommended (use `SDL_RENDER_DRIVER=opengles2 ./Tetris.kexe`).
For Windows `set SDL_RENDER_DRIVER=software` may be needed on some machines.
+14
View File
@@ -0,0 +1,14 @@
@echo off
setlocal
set DIR=.
set "PATH=..\..\dist\bin;..\..\bin;%PATH%"
if "%TARGET%" == "" set TARGET=mingw
set CFLAGS=-I\msys64\mingw64\include\SDL2
set LFLAGS=-L\msys64\mingw64\lib -lSDL2
call cinterop -def "%DIR%\sdl.def" -compilerOpts "%CFLAGS%" -target "%TARGET%" -o sdl || exit /b
call konanc -target "%TARGET%" "%DIR%\Tetris.kt" -library sdl -linkerOpts "%LFLAGS%" -opt -o Tetris || exit /b
copy Tetris.kexe Tetris.exe
copy \msys64\mingw64\bin\SDL2.dll SDL2.dll