alef-backend-kotlin 0.17.35

Kotlin (JVM) backend for alef
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
//! Emit the cinterop `.def` file for a Kotlin/Native project.

use alef_core::config::ResolvedCrateConfig;

/// Generate the contents of the `<crate>.def` cinterop definition file.
pub(super) fn emit_def_file(config: &ResolvedCrateConfig) -> String {
    let header = config.ffi_header_name();
    let lib_name = config.ffi_lib_name();
    let prefix = config.ffi_prefix();

    format!("headers = {header}\nheaderFilter = {prefix}_*\nlinkerOpts = -L../../../target/release -l{lib_name}\n")
}