How to use Kotlin native to compile a kotlin file which imports third party package

I have a Kotlin file

import kotlinx.datetime.Clock
fun currentTime(): Long {
    return Clock.System.now().toEpochMilliseconds()
}

However, kotlinx.datetime.Clock is from third party library. How can I pass the library libs.kotlinx.datetime to kotlin native compiler without using gradle?

It depends if kotlinx.datetime.Clock is coming from a Java library, or a Kotlin library, or a Kotlin native library. If it’s a Java/Kotlin library, the answer is that you can’t use it (unless you have the source code). Such libraries are published to places like Maven Central as Java Byte Code. The Kotlin native compiler doesn’t handle Java Byte Code (last I knew), because there are existing tools out there to do that, like GraalVM.

If it’s a Kotlin Native library, then apparently you can use a command-line argument to pass the library to the compiler: Kotlin compiler options | Kotlin Documentation