diff --git a/klib/src/platform/osx/objc.def b/klib/src/platform/osx/objc.def index 9631fe3b..510de838 100644 --- a/klib/src/platform/osx/objc.def +++ b/klib/src/platform/osx/objc.def @@ -7,6 +7,6 @@ headers = objc/List.h objc/NSObjCRuntime.h objc/NSObject.h objc/Object.h objc/Pr compilerOpts = -D_XOPEN_SOURCE linkerOpts = -lobjc - +depends = osx posix --- // objc-auto.h is excluded so far due to interop issues. diff --git a/klib/src/platform/osx/osx.def b/klib/src/platform/osx/osx.def index 8dfd8116..6573dc0c 100644 --- a/klib/src/platform/osx/osx.def +++ b/klib/src/platform/osx/osx.def @@ -28,6 +28,7 @@ headers = AppleTextureEncoder.h AssertMacros.h Availability.h AvailabilityIntern compilerOpts = -D_XOPEN_SOURCE linkerOpts = -ldl -lz +depends = posix --- diff --git a/klib/src/platform/osx/zlib.def b/klib/src/platform/osx/zlib.def index 46ed691d..e3cab7ba 100644 --- a/klib/src/platform/osx/zlib.def +++ b/klib/src/platform/osx/zlib.def @@ -1,3 +1,4 @@ package = platform.zlib headers = zconf.h zlib.h linkerOpts = -lz +depends=posix
Kotlin/Native
Kotlin/Native is a LLVM backend for the Kotlin compiler, runtime implementation and native code generation facility using LLVM toolchain.
Kotlin/Native is primarily designed to allow compilation for platforms where virtual machines are not desirable or possible (such as iOS, embedded targets), or where developer is willing to produce reasonably-sized self-contained program without need to ship an additional execution runtime.
To compile from sources use following steps.
First download dependencies:
./gradlew dependencies:update
Then build the compiler and standard library:
./gradlew dist
To build standard library for cross-targets use:
./gradlew cross_dist
After that you should be able to compile your programs like that:
export PATH=./dist/bin:$PATH
kotlinc hello.kt -o hello
For an optimized compilation use -opt:
kotlinc hello.kt -o hello -opt
For some tests, use:
./gradlew backend.native:tests:run
To generate interoperability stubs create library definition file
(take a look on samples/tetris/.../sdl.def) and run cinterop tool like this:
cinterop -def lib.def
See provided samples and INTEROP.md for more details.
Interop tool generates library in .klib library format, see LIBRARIES.md
for more details on the file format.