Small samples cleanup
This commit is contained in:
@@ -2,7 +2,12 @@ apply plugin: 'konan'
|
||||
|
||||
konanArtifacts {
|
||||
interop('libgit2') {
|
||||
includeDirs '/opt/local/include', '/usr/include', '/usr/local/include'
|
||||
target('linux') {
|
||||
includeDirs '/usr/include'
|
||||
}
|
||||
target('macbook') {
|
||||
includeDirs '/opt/local/include', '/usr/local/include'
|
||||
}
|
||||
}
|
||||
|
||||
program('GitChurn') {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
DIR=$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||
PATH=$DIR/../../dist/bin:$DIR/../../bin:$PATH
|
||||
|
||||
CFLAGS_macbook="-I/opt/local/include -compilerOpts -I/usr/local/include"
|
||||
CFLAGS_macbook="-I/opt/local/include -I/usr/local/include"
|
||||
CFLAGS_linux=-I/usr/include
|
||||
|
||||
if [ x$TARGET == x ]; then
|
||||
@@ -24,7 +24,7 @@ COMPILER_ARGS=${!var} # add -opt for an optimized build.
|
||||
mkdir -p $DIR/build/c_interop/
|
||||
mkdir -p $DIR/build/bin/
|
||||
|
||||
cinterop -compilerOpts $CFLAGS -def $DIR/src/main/c_interop/libgit2.def -target $TARGET \
|
||||
cinterop -compilerOpts "$CFLAGS" -def $DIR/src/main/c_interop/libgit2.def -target $TARGET \
|
||||
-o $DIR/build/c_interop/libgit2 || exit 1
|
||||
|
||||
konanc -target $TARGET $DIR/src/main/kotlin -library $DIR/build/c_interop/libgit2 \
|
||||
|
||||
@@ -4,7 +4,6 @@ DIR=$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||
PATH=$DIR/../../dist/bin:$DIR/../../bin:$PATH
|
||||
|
||||
IPREFIX_macbook=-I/opt/local/include
|
||||
#IPREFIX_macbook=-I/usr/local/include
|
||||
IPREFIX_linux=-I/usr/include
|
||||
|
||||
if [ x$TARGET == x ]; then
|
||||
@@ -17,17 +16,13 @@ fi
|
||||
|
||||
var=IPREFIX_${TARGET}
|
||||
IPREFIX="${!var}"
|
||||
var=LINKER_ARGS_${TARGET}
|
||||
LINKER_ARGS=${!var}
|
||||
var=COMPILER_ARGS_${TARGET}
|
||||
COMPILER_ARGS=${!var} # add -opt for an optimized build.
|
||||
|
||||
mkdir -p $DIR/build/c_interop/
|
||||
mkdir -p $DIR/build/bin/
|
||||
|
||||
echo "Generating GTK stubs, may take few mins depending on the hardware..."
|
||||
cinterop -J-Xmx8g -copt $IPREFIX/atk-1.0 -compilerOpts $IPREFIX/gdk-pixbuf-2.0 -copt $IPREFIX/cairo -copt $IPREFIX/pango-1.0 \
|
||||
-copt -I/opt/local/lib/glib-2.0/include -copt $IPREFIX/gtk-3.0 -copt $IPREFIX/glib-2.0 \
|
||||
cinterop -J-Xmx8g -compilerOpts "$IPREFIX/atk-1.0 $IPREFIX/gdk-pixbuf-2.0 $IPREFIX/cairo $IPREFIX/pango-1.0 \
|
||||
-I/opt/local/lib/glib-2.0/include $IPREFIX/gtk-3.0 $IPREFIX/glib-2.0" \
|
||||
-def $DIR/src/main/c_interop/gtk3.def -target $TARGET -o $DIR/build/c_interop/gtk3 || exit 1
|
||||
|
||||
konanc -target $TARGET $DIR/src/main/kotlin -library $DIR/build/c_interop/gtk3 \
|
||||
|
||||
+1
-15
@@ -3,23 +3,9 @@
|
||||
DIR=$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )
|
||||
PATH=$DIR/../../dist/bin:$DIR/../../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=COMPILER_ARGS_${TARGET}
|
||||
COMPILER_ARGS=${!var} # add -opt for an optimized build.
|
||||
|
||||
mkdir -p $DIR/build/c_interop/
|
||||
mkdir -p $DIR/build/bin/
|
||||
|
||||
konanc $COMPILER_ARGS -target $TARGET $DIR/src/main/kotlin/EchoServer.kt \
|
||||
konanc $COMPILER_ARGS $DIR/src/main/kotlin/EchoServer.kt \
|
||||
-o $DIR/build/bin/EchoServer || exit 1
|
||||
|
||||
echo "Artifact path is $DIR/build/bin/EchoServer.kexe"
|
||||
|
||||
Reference in New Issue
Block a user