How to Enable Context Receiver in Kotlin multiplatform?

I tried to do this:

tasks.withType<KotlinCompile> {
    kotlinOptions {
        freeCompilerArgs += listOf("-Xcontext-receivers")
    }
}

but it din’t work.
How to enable it properly in kotlin multiplatform project?

I don’t have an example handy right now, but I’d be surprised if it’s not documented here: Compiler options in the Kotlin Gradle plugin | Kotlin Documentation

As far as I know, the entire context-receivers feature seems to only be supported by the JVM platform as of now. Meaning, given your build-script, it should only work in the jvmMain and jvmTest source set respectively.

I might be wrong though.