Files
kotlin-fork/samples/csvparser/build.sh
T
alexander-gorshenev c9c9aee7bb No colon cinterop flags (#428)
* Taught cinterop a 'host' target.

* Last minute switch from -foo:bar flags to -foo bar flags in cinterop tool.
2017-03-31 10:20:29 +03:00

23 lines
583 B
Bash
Executable File

#!/usr/bin/env bash
DIR=.
PATH=../../dist/bin:../../bin:$PATH
if [ x$TARGET == x ]; then
case "$OSTYPE" in
darwin*) TARGET=macbook ;;
linux*) TARGET=linux ;;
*) echo "unknown: $OSTYPE" && exit 1;;
esac
fi
var=CFLAGS_${TARGET}
CFLAGS=${!var}
var=LINKER_ARGS_${TARGET}
LINKER_ARGS=${!var}
var=COMPILER_ARGS_${TARGET}
COMPILER_ARGS=${!var} # add -opt for an optimized build.
cinterop -def $DIR/stdio.def -copt "$CFLAGS" -target $TARGET -o stdio.kt.bc || exit 1
konanc $COMPILER_ARGS -target $TARGET $DIR/CsvParser.kt -library stdio.kt.bc -o CsvParser.kexe || exit 1