How can I create a commonNative sourceSet (or bett...
# multiplatform
b
How can I create a commonNative sourceSet (or better yet, target) with access to native stdlib and depend on it from linux and mingw targets?
b
How do i setup cinterop for the shared desktop sourceSet?
d
You have to do it for each target. The shared source set will magically inherit it.
k
correct, cinterop is specified at the compilation level
Copy code
targets.withType<KotlinNativeTarget> {
        compilations.getByName("main") {
            defaultSourceSet {
                if (name != "iosMain") {
                    dependsOn(sourceSets["iosMain"])
                }
            }

            cinterops.create("phonenumbers") {
                includeDirs("c_interop/libPhoneNumber_iOS.framework/Headers")
            }
        }
        binaries.framework {
            baseName = "${project.extra["iosFrameworkName"]}"
            linkerOpts.add("-Fc_interop")
        }
    }