Skip to content

Commit

Permalink
Jolt: add the buildType() method
Browse files Browse the repository at this point in the history
  • Loading branch information
stephengold committed Jun 28, 2024
1 parent f2920dc commit 5b3a1cb
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main/java/com/github/stephengold/joltjni/Jolt.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ private Jolt() {
// *************************************************************************
// new methods exposed

/**
* Return the jolt-jni build-type string.
*
* @return either "Debug" or "Release"
*/
final native public static String buildType();

/**
* Destroy the factory for deserialization of saved data.
*
Expand Down
16 changes: 16 additions & 0 deletions src/main/native/glue/com_github_stephengold_joltjni_Jolt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,22 @@ SOFTWARE.

using namespace JPH;

/*
* Class: com_github_stephengold_joltjni_Jolt
* Method: buildType
* Signature: ()Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_com_github_stephengold_joltjni_Jolt_buildType
(JNIEnv *pEnv, jclass) {
jstring result;
#ifdef JPH_ENABLE_ASSERTS
result = pEnv->NewStringUTF("Debug");
#else
result = pEnv->NewStringUTF("Release");
#endif // JPH_ENABLE_ASSERTS
return result;
}

/*
* Class: com_github_stephengold_joltjni_Jolt
* Method: destroyFactory
Expand Down

0 comments on commit 5b3a1cb

Please sign in to comment.