Skip to content

Commit

Permalink
[mingw] samples/tetris: static link (JetBrains#1891)
Browse files Browse the repository at this point in the history
  • Loading branch information
msink authored and olonho committed Aug 16, 2018
1 parent 40d478b commit d3d6d49
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
5 changes: 2 additions & 3 deletions samples/tetris/build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ set MINGW=\msys64\mingw64

set "CFLAGS=-I%MINGW%\include\SDL2"
rem Add -Wl,--subsystem,windows for making GUI subsystem application.
set "LFLAGS=%DIR%\Tetris.res -L%MINGW%\lib -lSDL2"
set "LFLAGS=%DIR%\Tetris.res -L%MINGW%\lib -Wl,-Bstatic -lstdc++ -static -lSDL2 -limm32 -lole32 -loleaut32 -lversion -lwinmm -mwindows"

call cinterop -def "%DIR%\src\main\c_interop\sdl.def" -compilerOpts "%CFLAGS%" -target "%TARGET%" -o sdl || exit /b
rem Windows build requires Windows Resource Compiler in paths.
call windres "%DIR%\Tetris.rc" -O coff -o "%DIR%\Tetris.res" || exit /b
call konanc -target "%TARGET%" "%DIR%\src\main\kotlin\Tetris.kt" -library sdl -linkerOpts "%LFLAGS%" -opt -o Tetris || exit /b
call konanc -target "%TARGET%" "%DIR%\src\main\kotlin" -library sdl -linkerOpts "%LFLAGS%" -opt -o Tetris || exit /b

copy %MINGW%\bin\SDL2.dll SDL2.dll
copy src\main\resources\tetris_all.bmp tetris_all.bmp
6 changes: 0 additions & 6 deletions samples/tetris/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,6 @@ compileKonan {
from 'src/main/resources'
into task.artifact.parentFile
}
if (task.name.endsWith('Mingw_x64')) {
copy {
from "${System.getenv("MINGW64_DIR")?:"c:/msys64/mingw64"}/bin/SDL2.dll"
into task.artifact.parentFile
}
}
}
}
}
2 changes: 1 addition & 1 deletion samples/tetris/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ mkdir -p $DIR/build/bin/

cinterop -def $DIR/src/main/c_interop/sdl.def -compilerOpts "$CFLAGS" -target $TARGET -o $DIR/build/c_interop/sdl || exit 1

konanc $COMPILER_ARGS -target $TARGET $DIR/src/main/kotlin/Tetris.kt \
konanc $COMPILER_ARGS -target $TARGET $DIR/src/main/kotlin \
-library $DIR/build/c_interop/sdl -linkerOpts "$LINKER_ARGS" \
-o $DIR/build/bin/Tetris || exit 1

Expand Down

0 comments on commit d3d6d49

Please sign in to comment.