This is more of a build question I guess. I'm tryi...
# kotlin-native
d
This is more of a build question I guess. I'm trying to build a native target that uses ncurses. I've created a def file and tweaked binary target. I can see in the build that ncurses.kt file was created. What do I have to change in the build to start using ncurses in the commonMain source code?
Here's what I have so far:
Copy code
kotlin {
    jvm()

    // For ARM, should be changed to iosArm32 or iosArm64
    // For Linux, should be changed to e.g. linuxX64
    // For MacOS, should be changed to e.g. macosX64
    // For Windows, should be changed to e.g. mingwX64
    macosX64("macos") {
        binaries {
            executable {
                linkerOpts = ['-lncurses']
                entryPoint = "sample.main"
            }
        }
        compilations.main {
            cinterops {
                ncurses {
                    defFile project.file("./src/nativeInterop/cinterop/ncurses.def")
                    compilerOpts '-I/usr/local/opt/ncurses/include'
                }
            }
        }
    }
    sourceSets {
        commonMain {
            dependencies {
                implementation kotlin('stdlib-common')
            }
        }
        commonTest {
            dependencies {
                implementation kotlin('test-common')
                implementation kotlin('test-annotations-common')
            }
        }
        jvmMain {
            dependencies {
                implementation kotlin('stdlib-jdk8')
            }
        }
        jvmTest {
            dependencies {
                implementation kotlin('test')
                implementation kotlin('test-junit')
            }
        }
        macosMain {
        }
        macosTest {
        }
    }
}
Oh, never mind. It's actually available in the macosMain.