mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-12 15:07:11 -06:00
System File Chooser: Linux: cross-compile native library for ARM64 on x86_64 Linux
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
// avoid inlining of printf()
|
||||
#define _NO_CRT_STDIO_INLINE
|
||||
|
||||
#include <dlfcn.h>
|
||||
#include "JNIUtils.h"
|
||||
|
||||
/**
|
||||
@@ -35,3 +36,19 @@ AutoReleaseStringUTF8::~AutoReleaseStringUTF8() {
|
||||
if( chars != NULL )
|
||||
env->ReleaseStringUTFChars( javaString, chars );
|
||||
}
|
||||
|
||||
//---- JNI methods ------------------------------------------------------------
|
||||
|
||||
extern "C"
|
||||
JNIEXPORT jboolean JNICALL Java_com_formdev_flatlaf_ui_FlatNativeLinuxLibrary_isLibAvailable
|
||||
( JNIEnv* env, jclass cls, jstring libname )
|
||||
{
|
||||
AutoReleaseStringUTF8 clibname( env, libname );
|
||||
|
||||
void* lib = dlopen( clibname, RTLD_LAZY );
|
||||
if( lib == NULL )
|
||||
return false;
|
||||
|
||||
dlclose( lib );
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user