headerFilterOnly

abstract fun headerFilterOnly(vararg includeDirs: Any)

Additional directories to search for headers listed in the headers property in the .def file. It's equivalent to the -headerFilterAdditionalSearchPrefix cinterop tool 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 {
headerFilterOnly(project.file("include/libs"))
}
}
}
}
}
}

In the example, the directory include/libs is specified as the prefix for the directories listed in the headers declared in the custom.def.

Parameters

includeDirs

The directories to be included as prefixes for the header filters.


abstract fun headerFilterOnly(includeDirs: Collection<Any>)

Additional directories to search for headers listed in the headers property in the .def file. It's equivalent to the -headerFilterAdditionalSearchPrefix cinterop tool 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 {
headerFilterOnly(listOf(project.file("include/libs")))
}
}
}
}
}
}

In the example, the directory include/libs is specified as the prefix for the directories listed in the headers declared in the custom.def.

Parameters

includeDirs

The collection of directories to be included as prefixes for the header filters.

See also