Skip to content

More native targets #7

Description

@natario1

We need to add support for desktop native targets. For this to work, one must:

  • cinterop jni.h for them
  • cinterop again jni.h for androidNative, even though it's already available as a platformLib, because this way the cinterop commonizer will be able to create a common API for all native targets.

About cinterop for desktop targets:

  1. Technically, headers may differ between different JDK versions, while we don't know what JDK will be used by the library consumer. In practice I don't think JNI headers differ at all, so we may stick with headers from JDK 17 for example.

  2. We want to cross-compile this JNI module for all targets from macOS. But I think this means we can't use the common strategy of just pulling the headers from the local JDK installation (like here). jni.h is always the same, but there's a machine dependent header too jni_md.h.

    One possible solution is to use AOSP prebuilts: https://android.googlesource.com/platform/prebuilts/jdk/jdk17 contains JDK headers and binaries for all platforms. It's already added as a git submodule.

  3. It is my understanding that it's fine to cinterop with just the header and don't pass link instructions (e.g. path to libjvm.so) since the JVM already takes care of this.

I'm not 100% sure about the 3 bullet points above though. I'd appreciate if someone with desktop native+JVM experience could confirm.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions