allHeaders

abstract fun allHeaders(vararg includeDirs: Any)

A collection of directories to search for headers. It's the equivalent of the -I<path> compiler option.

Usage example

The following example demonstrates how to add multiple directories containing header files in a build.gradle.kts file:

//build.gradle.kts
kotlin {
linuxX64() {
compilations.getByName("main") {
cinterops {
val cinterop by creating {
defFile(project.file("custom.def"))
includeDirs {
allHeaders(project.file("src/main/headersDir1"), project.file("src/main/headersDir2"))
}
}
}
}
}
}

In the example, the directories src/main/headersDir1 and src/main/headersDir2 in the project directory are specified as locations containing the header files required for the cinterop process.

Parameters

includeDirs

The directories to be included.


abstract fun allHeaders(includeDirs: Collection<Any>)

A collection of directories to search for headers. It's the equivalent of the -I<path> compiler option.

Usage example

The following example demonstrates how to add multiple directories containing header files in a build.gradle.kts file:

//build.gradle.kts
kotlin {
linuxX64() {
compilations.getByName("main") {
cinterops {
val cinterop by creating {
defFile(project.file("custom.def"))
includeDirs {
allHeaders(listOf(project.file("src/main/headersDir1"), project.file("src/main/headersDir2")))
}
}
}
}
}
}

In the example, the directories src/main/headersDir1 and src/main/headersDir2 in the project directory are specified as locations containing the header files required for the cinterop process.

Parameters

includeDirs

The collection of directories to be included

See also