CMake Integration
SCAPIX_JAVA_API automatically selects platform
from Android API version your project targets or JDK version used.
You can override this automatic selection.
You can also generate additional java_api C++ headers from any (compiled) java code using scapix_java utility.
Configuration options
SCAPIX_JNI_CACHE_CLASS_LOADER, default: ON
In some JVM scenarios (notably on Android), JNI FindClass() fails to load application classes when called from C++ created threads. More information here: Why didn’t FindClass find my class?. This implements the option “Cache a reference to the ClassLoader object somewhere handy, and issue loadClass calls directly.”
SCAPIX_JNI_AUTO_ATTACH_THREAD, default: ON
Threads created by Java are already “attached” to JVM, but if you call Java code from threads created in C++,
each such thread needs to call scapix::jni::attach_thread() at least once. This option enables automatic attachment, at the expense of slight overhead.
SCAPIX_JNI_STANDARD_UTF8, default: ON
By default, C++ std::string objects created from Java strings use standard UTF8 encoding. If disabled, modified UTF8 is used instead. This may provide better performance, depending on JVM implementation.
C++ dependency management
Scapix uses cmodule for CMake dependency management.
You can also add additional dependencies to your project
and cmodule will automatically download and build these libraries
for any target platform like iOS, Android, WebAssembly, etc.