Provide nicer Tetris build env (#350)
This commit is contained in:
Regular → Executable
+24
-2
@@ -1,2 +1,24 @@
|
|||||||
./dist/bin/interop -def:sdl_test/sdl.def
|
#!/usr/bin/env bash
|
||||||
./dist/bin/konanc sdl_test/tetris.kt SDL/SDL.kt -nativelibrary sdlstubs.bc -linkerArg -F -linkerArg /Library/Frameworks -linkerArg -framework -linkerArg SDL2
|
|
||||||
|
DIR=.
|
||||||
|
DIST=../../dist
|
||||||
|
OSX_CFLAGS=-I/Library/Frameworks/SDL2.framework/Headers
|
||||||
|
OSX_LINKER_ARGS="-F /Library/Frameworks -framework SDL2"
|
||||||
|
LINUX_CFLAGS=-I/usr/include/SDL2
|
||||||
|
LINUX_LINKER_ARGS="-L/usr/lib/x86_64-linux-gnu -lSDL2"
|
||||||
|
|
||||||
|
case "$OSTYPE" in
|
||||||
|
darwin*) OS=OSX ;;
|
||||||
|
linux*) OS=LINUX ;;
|
||||||
|
*) echo "unknown: $OSTYPE" && exit 1;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
var=${OS}_CFLAGS
|
||||||
|
CFLAGS=${!var}
|
||||||
|
var=${OS}_LINKER_ARGS
|
||||||
|
LINKER_ARGS=${!var}
|
||||||
|
|
||||||
|
$DIST/bin/interop -def:$DIR/sdl.def -copt:$CFLAGS || exit 1
|
||||||
|
$DIST/bin/konanc -opt $DIR/tetris.kt sdl -nativelibrary sdlstubs.bc -linkerArgs "$LINKER_ARGS" -o tetris.kexe || exit 1
|
||||||
|
strip tetris.kexe
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
headers = /Library/Frameworks/SDL2.framework/Headers/SDL.h stdio.h string.h unistd.h stdlib.h time.h
|
headers = SDL.h stdio.h string.h unistd.h stdlib.h time.h
|
||||||
excludedFunctions = _IO_flockfile _IO_funlockfile _IO_ftrylockfile _IO_cleanup_region_start _IO_cleanup_region_end \
|
excludedFunctions = _IO_flockfile _IO_funlockfile _IO_ftrylockfile \
|
||||||
|
_IO_cleanup_region_start _IO_cleanup_region_end \
|
||||||
mkstemp_dprotected_np
|
mkstemp_dprotected_np
|
||||||
|
|
||||||
compilerOpts = -D_POSIX_SOURCE -mxsave -mavx -mf16c
|
compilerOpts.osx = -D_POSIX_SOURCE -mxsave -mavx -mf16c
|
||||||
|
compilerOpts.linux = -D_REENTRANT
|
||||||
|
|
||||||
|
linkerOpts.linux = -lm
|
||||||
|
|||||||
Reference in New Issue
Block a user