Fix build
This commit is contained in:
Regular → Executable
+8
-8
@@ -1,8 +1,8 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
|
||||||
DIR=$(dirname "$0")
|
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
PATH=../../dist/bin:../../bin:$PATH
|
PATH=$DIR/../../dist/bin:$DIR/../../bin:$PATH
|
||||||
|
|
||||||
if [ x$TARGET == x ]; then
|
if [ x$TARGET == x ]; then
|
||||||
case "$OSTYPE" in
|
case "$OSTYPE" in
|
||||||
@@ -19,12 +19,12 @@ LINKER_ARGS=${!var}
|
|||||||
var=COMPILER_ARGS_${TARGET}
|
var=COMPILER_ARGS_${TARGET}
|
||||||
COMPILER_ARGS=${!var} # add -opt for an optimized build.
|
COMPILER_ARGS=${!var} # add -opt for an optimized build.
|
||||||
|
|
||||||
rm -rf $DIR/build/
|
rm -rf $DIR/build
|
||||||
mkdir $DIR/build/
|
mkdir $DIR/build
|
||||||
mkdir $DIR/build/c_interop/
|
mkdir $DIR/build/c_interop
|
||||||
mkdir $DIR/build/bin/
|
mkdir $DIR/build/bin
|
||||||
|
|
||||||
./buildCpp.sh
|
$DIR/buildCpp.sh
|
||||||
|
|
||||||
cinterop -def $DIR/src/c_interop/MessageChannel.def -copt "-I$DIR/src/cpp" -target $TARGET \
|
cinterop -def $DIR/src/c_interop/MessageChannel.def -copt "-I$DIR/src/cpp" -target $TARGET \
|
||||||
-o $DIR/build/c_interop/MessageChannel.kt.bc || exit 1
|
-o $DIR/build/c_interop/MessageChannel.kt.bc || exit 1
|
||||||
@@ -32,4 +32,4 @@ cinterop -def $DIR/src/c_interop/MessageChannel.def -copt "-I$DIR/src/cpp" -targ
|
|||||||
konanc $DIR/src/kotlin-native/Concurrent.kt -library $DIR/build/c_interop/MessageChannel.kt.bc \
|
konanc $DIR/src/kotlin-native/Concurrent.kt -library $DIR/build/c_interop/MessageChannel.kt.bc \
|
||||||
-nativelibrary $DIR/build/clang/MessageChannel.bc -o $DIR/build/bin/Concurrent.kexe || exit 1
|
-nativelibrary $DIR/build/clang/MessageChannel.bc -o $DIR/build/bin/Concurrent.kexe || exit 1
|
||||||
|
|
||||||
echo "Artifact path is ./build/bin/Concurrent.kexe"
|
echo "Artifact path is $DIR/build/bin/Concurrent.kexe"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
DIR=$(dirname "$0")
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
PATH=../../dist/bin:../../bin:$PATH
|
PATH=../../dist/bin:../../bin:$PATH
|
||||||
DEPS=$(dirname `type -p konanc`)/../dependencies
|
DEPS=$(dirname `type -p konanc`)/../dependencies
|
||||||
|
|
||||||
@@ -18,7 +18,7 @@ CLANG_macbook=$DEPS/clang-llvm-3.9.0-darwin-macos/bin/clang++
|
|||||||
var=CLANG_${TARGET}
|
var=CLANG_${TARGET}
|
||||||
CLANG=${!var}
|
CLANG=${!var}
|
||||||
|
|
||||||
mkdir $DIR/build/
|
mkdir -p $DIR/build
|
||||||
mkdir $DIR/build/clang/
|
mkdir -p $DIR/build/clang
|
||||||
|
|
||||||
$CLANG -std=c++11 -c $DIR/src/cpp/MessageChannel.cpp -o $DIR/build/clang/MessageChannel.bc -emit-llvm || exit 1
|
$CLANG -std=c++11 -c $DIR/src/cpp/MessageChannel.cpp -o $DIR/build/clang/MessageChannel.bc -emit-llvm || exit 1
|
||||||
|
|||||||
Regular → Executable
+3
-3
@@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
DIR=$(dirname "$0")
|
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
PATH=../../dist/bin:../../bin:$PATH
|
PATH=$DIR/../../dist/bin:$DIR/../../bin:$PATH
|
||||||
|
|
||||||
if [ x$TARGET == x ]; then
|
if [ x$TARGET == x ]; then
|
||||||
case "$OSTYPE" in
|
case "$OSTYPE" in
|
||||||
@@ -28,4 +28,4 @@ cinterop -def $DIR/src/c_interop/stdio.def -copt "$CFLAGS" -target $TARGET -o $D
|
|||||||
konanc $COMPILER_ARGS -target $TARGET $DIR/src/kotlin-native/CsvParser.kt -library $DIR/build/c_interop/stdio.kt.bc \
|
konanc $COMPILER_ARGS -target $TARGET $DIR/src/kotlin-native/CsvParser.kt -library $DIR/build/c_interop/stdio.kt.bc \
|
||||||
-o $DIR/build/bin/CsvParser.kexe || exit 1
|
-o $DIR/build/bin/CsvParser.kexe || exit 1
|
||||||
|
|
||||||
echo "Artifact path is ./build/bin/CsvParser.kexe"
|
echo "Artifact path is $DIR/build/bin/CsvParser.kexe"
|
||||||
|
|||||||
Regular → Executable
+3
-3
@@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
DIR=$(dirname "$0")
|
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
PATH=../../dist/bin:../../bin:$PATH
|
PATH=$DIR/../../dist/bin:$DIR/../../bin:$PATH
|
||||||
|
|
||||||
CFLAGS_macbook="-I/opt/local/include -copt -I/usr/local/include"
|
CFLAGS_macbook="-I/opt/local/include -copt -I/usr/local/include"
|
||||||
CFLAGS_linux=-I/usr/include
|
CFLAGS_linux=-I/usr/include
|
||||||
@@ -34,4 +34,4 @@ cinterop -copt $CFLAGS -def $DIR/src/c_interop/libgit2.def -target $TARGET \
|
|||||||
konanc -target $TARGET $DIR/src/kotlin-native -library $DIR/build/c_interop/libgit2.kt.bc -linkerArgs "$LINKER_ARGS" \
|
konanc -target $TARGET $DIR/src/kotlin-native -library $DIR/build/c_interop/libgit2.kt.bc -linkerArgs "$LINKER_ARGS" \
|
||||||
-o $DIR/build/bin/GitChurn.kexe || exit 1
|
-o $DIR/build/bin/GitChurn.kexe || exit 1
|
||||||
|
|
||||||
echo "Artifact path is ./build/bin/GitChurn.kexe"
|
echo "Artifact path is $DIR/build/bin/GitChurn.kexe"
|
||||||
|
|||||||
Regular → Executable
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
DIR=$(dirname "$0")
|
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
PATH=../../dist/bin:../../bin:$PATH
|
PATH=../../dist/bin:../../bin:$PATH
|
||||||
|
|
||||||
IPREFIX_macbook=-I/opt/local/include
|
IPREFIX_macbook=-I/opt/local/include
|
||||||
@@ -38,4 +38,4 @@ cinterop -J-Xmx8g -copt $IPREFIX/atk-1.0 -copt $IPREFIX/gdk-pixbuf-2.0 -copt $IP
|
|||||||
konanc -target $TARGET $DIR/src/kotlin-native -library $DIR/build/c_interop/gtk3.bc -linkerArgs "$LINKER_ARGS" \
|
konanc -target $TARGET $DIR/src/kotlin-native -library $DIR/build/c_interop/gtk3.bc -linkerArgs "$LINKER_ARGS" \
|
||||||
-o $DIR/build/bin/Gtk3Demo.kexe || exit 1
|
-o $DIR/build/bin/Gtk3Demo.kexe || exit 1
|
||||||
|
|
||||||
echo "Artifact path is ./build/bin/Gtk3Demo.kexe"
|
echo "Artifact path is $DIR/build/bin/Gtk3Demo.kexe"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
DIR=$(dirname "$0")
|
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
PATH=../../dist/bin:../../bin:$PATH
|
PATH=$DIR/../../dist/bin:$DIR/../../bin:$PATH
|
||||||
|
|
||||||
CFLAGS_macbook=-I/opt/local/include
|
CFLAGS_macbook=-I/opt/local/include
|
||||||
CFLAGS_linux=-I/usr/include/x86_64-linux-gnu
|
CFLAGS_linux=-I/usr/include/x86_64-linux-gnu
|
||||||
@@ -34,4 +34,4 @@ cinterop -copt "$CFLAGS" -copt -I$DIR -copt -I/usr/include -def $DIR/src/c_inter
|
|||||||
konanc -target $TARGET $DIR/src/kotlin-native -library $DIR/build/c_interop/libcurl.bc -linkerArgs "$LINKER_ARGS" \
|
konanc -target $TARGET $DIR/src/kotlin-native -library $DIR/build/c_interop/libcurl.bc -linkerArgs "$LINKER_ARGS" \
|
||||||
-o $DIR/build/bin/Curl.kexe || exit 1
|
-o $DIR/build/bin/Curl.kexe || exit 1
|
||||||
|
|
||||||
echo "Artifact path is ./build/bin/Curl.kexe"
|
echo "Artifact path is $DIR/build/bin/Curl.kexe"
|
||||||
|
|||||||
Regular → Executable
+3
-3
@@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
DIR=$(dirname "$0")
|
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
PATH=../../dist/bin:../../bin:$PATH
|
PATH=$DIR/../../dist/bin:$DIR/../../bin:$PATH
|
||||||
|
|
||||||
if [ x$TARGET == x ]; then
|
if [ x$TARGET == x ]; then
|
||||||
case "$OSTYPE" in
|
case "$OSTYPE" in
|
||||||
@@ -29,4 +29,4 @@ cinterop -def $DIR/src/c_interop/sockets.def -copt "$CFLAGS" -target $TARGET \
|
|||||||
konanc $COMPILER_ARGS -target $TARGET $DIR/src/kotlin-native/EchoServer.kt \
|
konanc $COMPILER_ARGS -target $TARGET $DIR/src/kotlin-native/EchoServer.kt \
|
||||||
-library $DIR/build/c_interop/sockets.kt.bc -o build/bin/EchoServer.kexe || exit 1
|
-library $DIR/build/c_interop/sockets.kt.bc -o build/bin/EchoServer.kexe || exit 1
|
||||||
|
|
||||||
echo "Artifact path is ./build/bin/EchoServer.kexe"
|
echo "Artifact path is $DIR/build/bin/EchoServer.kexe"
|
||||||
|
|||||||
Regular → Executable
+3
-3
@@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
DIR=$(dirname "$0")
|
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
PATH=../../dist/bin:../../bin:$PATH
|
PATH=$DIR/../../dist/bin:$DIR/../../bin:$PATH
|
||||||
|
|
||||||
LINKER_ARGS_macbook="-framework OpenGL -framework GLUT"
|
LINKER_ARGS_macbook="-framework OpenGL -framework GLUT"
|
||||||
LINKER_ARGS_linux="-L/usr/lib/x86_64-linux-gnu -lglut -lGL -lGLU"
|
LINKER_ARGS_linux="-L/usr/lib/x86_64-linux-gnu -lglut -lGL -lGLU"
|
||||||
@@ -32,4 +32,4 @@ cinterop -def $DIR/src/c_interop/opengl.def -target $TARGET \
|
|||||||
konanc -target $TARGET $DIR/src/kotlin-native/OpenGlTeapot.kt -library $DIR/build/c_interop/opengl.kt.bc \
|
konanc -target $TARGET $DIR/src/kotlin-native/OpenGlTeapot.kt -library $DIR/build/c_interop/opengl.kt.bc \
|
||||||
-linkerArgs "$LINKER_ARGS" -o $DIR/build/bin/OpenGlTeapot.kexe || exit 1
|
-linkerArgs "$LINKER_ARGS" -o $DIR/build/bin/OpenGlTeapot.kexe || exit 1
|
||||||
|
|
||||||
echo "Artifact path is ./build/bin/OpenGlTeapot.kexe"
|
echo "Artifact path is $DIR/build/bin/OpenGlTeapot.kexe"
|
||||||
|
|||||||
Regular → Executable
+3
-3
@@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
DIR=$(dirname "$0")
|
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
PATH=../../dist/bin:../../bin:$PATH
|
PATH=$DIR/../../dist/bin:$DIR/../../bin:$PATH
|
||||||
|
|
||||||
if [ x$TARGET == x ]; then
|
if [ x$TARGET == x ]; then
|
||||||
case "$OSTYPE" in
|
case "$OSTYPE" in
|
||||||
@@ -30,4 +30,4 @@ konanc $COMPILER_ARGS -target $TARGET $DIR/src/kotlin-native/EchoServer.kt \
|
|||||||
-library $DIR/build/c_interop/sockets.kt.bc \
|
-library $DIR/build/c_interop/sockets.kt.bc \
|
||||||
-o $DIR/build/bin/EchoServer.kexe || exit 1
|
-o $DIR/build/bin/EchoServer.kexe || exit 1
|
||||||
|
|
||||||
echo "Artifact path is ./build/bin/EchoServer.kexe"
|
echo "Artifact path is $DIR/build/bin/EchoServer.kexe"
|
||||||
|
|||||||
Regular → Executable
+3
-3
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
./downloadTensorflow.sh
|
./downloadTensorflow.sh
|
||||||
|
|
||||||
DIR=$(dirname "$0")
|
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
PATH=../../dist/bin:../../bin:$PATH
|
PATH=$DIR/../../dist/bin:$DIR/../../bin:$PATH
|
||||||
|
|
||||||
TF_TARGET_DIRECTORY="$HOME/.konan/third-party/tensorflow"
|
TF_TARGET_DIRECTORY="$HOME/.konan/third-party/tensorflow"
|
||||||
TF_TYPE="cpu" # Change to "gpu" for GPU support
|
TF_TYPE="cpu" # Change to "gpu" for GPU support
|
||||||
@@ -41,4 +41,4 @@ konanc $COMPILER_ARGS -target $TARGET $DIR/src/kotlin-native/HelloTensorflow.kt
|
|||||||
|
|
||||||
echo "Note: You may need to specify LD_LIBRARY_PATH or DYLD_LIBRARY_PATH env variables to $TF_TARGET_DIRECTORY/lib if the TensorFlow dynamic library cannot be found."
|
echo "Note: You may need to specify LD_LIBRARY_PATH or DYLD_LIBRARY_PATH env variables to $TF_TARGET_DIRECTORY/lib if the TensorFlow dynamic library cannot be found."
|
||||||
|
|
||||||
echo "Artifact path is ./build/bin/HelloTensorflow.kexe"
|
echo "Artifact path is $DIR/build/bin/HelloTensorflow.kexe"
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ To run it on the host use `../gradlew run`
|
|||||||
|
|
||||||
Alternatively you can run artifact directly
|
Alternatively you can run artifact directly
|
||||||
|
|
||||||
./build/konan/bin/Tetris${target}/Tetris${target}.kexe
|
./build/bin/Tetris.kexe
|
||||||
|
|
||||||
For cross-compilation to iOS (on Mac host) use gradle property
|
For cross-compilation to iOS (on Mac host) use gradle property
|
||||||
|
|
||||||
|
|||||||
Regular → Executable
+3
-3
@@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
DIR=$(dirname "$0")
|
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
PATH=../../dist/bin:../../bin:$PATH
|
PATH=$DIR/../../dist/bin:$DIR/../../bin:$PATH
|
||||||
DEPS=$(dirname `type -p konanc`)/../dependencies
|
DEPS=$(dirname `type -p konanc`)/../dependencies
|
||||||
|
|
||||||
CFLAGS_macbook=-I$HOME/Library/Frameworks/SDL2.framework/Headers
|
CFLAGS_macbook=-I$HOME/Library/Frameworks/SDL2.framework/Headers
|
||||||
@@ -55,4 +55,4 @@ konanc $COMPILER_ARGS -target $TARGET $DIR/src/kotlin-native/Tetris.kt \
|
|||||||
|
|
||||||
cp -R $DIR/src/resources $DIR/build/bin
|
cp -R $DIR/src/resources $DIR/build/bin
|
||||||
|
|
||||||
echo "Artifact path is ./build/bin/Tetris.kexe"
|
echo "Artifact path is $DIR/build/bin/Tetris.kexe"
|
||||||
|
|||||||
+1
-1
@@ -80,7 +80,7 @@ open class KonanCompileTask: DefaultTask() {
|
|||||||
|
|
||||||
// Output artifact --------------------------------------------------------
|
// Output artifact --------------------------------------------------------
|
||||||
|
|
||||||
protected lateinit var artifactName: String
|
lateinit var artifactName: String
|
||||||
|
|
||||||
@OutputDirectory
|
@OutputDirectory
|
||||||
lateinit var outputDir: File
|
lateinit var outputDir: File
|
||||||
|
|||||||
Reference in New Issue
Block a user