Also, how can i create a common `KotlinNativeSourc...
# kotlin-native
b
Also, how can i create a common
KotlinNativeSourceSet
with cinterops?
a
IIRC, this option is not available now.
k
cinterop is specified per binary, which is at the target level, not the source set level
sorry, it's actually per compliation
however, you can do something along these lines:
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")
        }
    }