Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More native targets #7

Open
natario1 opened this issue Jun 12, 2024 · 0 comments
Open

More native targets #7

natario1 opened this issue Jun 12, 2024 · 0 comments

Comments

@natario1
Copy link
Member

natario1 commented Jun 12, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant