Closed Glavo closed 1 year ago
I’m not opposed to the idea, but could you elaborate how do you see it working for users? If we start supporting new platforms, isn’t it better to contribute them to upstream?
I’m not opposed to the idea, but could you elaborate how do you see it working for users? If we start supporting new platforms, isn’t it better to contribute them to upstream?
It would really be best if support for all platforms could be provided upstream. However, I guess this is not an easy thing to do.
linux-s390x
, linux-mips64
, linux-ppc64el
, linux-loongarch64
and other platforms)For the above reasons, I think it is reasonable for upstream to only provide support for popular platforms.
So what are you suggesting? Check java.library.path for dll/so/dylib before extracting in Library.java?
I noticed that skija was hardcoding the supported platforms and forcing to extract and load native libraries from known platform jars.
This is frustrating to me, and I hope that skija can improve the way that native libraries are loaded, making it more flexible for users to provide native libraries.
This is my idea:
windows-arm64
,linux-loongarch64
, etc.java.library.path
. Extracting the dynamic library every time it runs is easy to use, but it's not the best strategy. I figured we could reduce unnecessary operations and hard disk usage by trying to load native libraries fromjava.library.path
. We can use a JVM Property to specify whether it wants to load native libraries from java.library.path. In addition to this, doing so is beneficial to provide jmod distribution (#54). When provided as jmod, the native library is placed in the JRE's lib directory by jlink. We can tell if skija is being used as jmod by checking if the class file is in the jrt filesystem, which loads native libraries fromjava.library.path
by default.These are my suggestions, what do you think? I can get the job done if that's acceptable.