Skip to content

Commit

Permalink
feat(core) add option that disables hash checks
Browse files Browse the repository at this point in the history
  • Loading branch information
Spasi committed Oct 3, 2024
1 parent 647f7b3 commit 7b6ba7d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions doc/notes/3.3.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ This build includes the following changes:

#### Improvements

- Core: Added `Configuration.DISABLE_HASH_CHECKS`, a dynamic option that disables shared library hash checks. (#1007)
- msdfgen: Added support for glyph index based msdfgen-ext APIs. (#1002)

#### Fixes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,20 @@ public class Configuration<T> {
*/
public static final Configuration<Boolean> DISABLE_FUNCTION_CHECKS = new Configuration<>("org.lwjgl.util.NoFunctionChecks", StateInit.BOOLEAN);

/**
* Set to true to disable LWJGL's shared library hash checks.
*
* <p>LWJGL compares the shared library hash stored in the classpath, with the hash of the actual library loaded at runtime. These checks print a simple
* warning when there's a hash mismatch, to help diagnose installation/classpath issues. It is not a security feature.</p>
*
* <p>If this option is not set, it defaults to the value of {@link #DISABLE_CHECKS}.</p>
*
* <p style="font-family: monospace">
* Property: <b>org.lwjgl.util.NoLibraryChecks</b><br>
* &nbsp; &nbsp;Usage: Dynamic</p>
*/
public static final Configuration<Boolean> DISABLE_HASH_CHECKS = new Configuration<>("org.lwjgl.util.NoHashChecks", StateInit.BOOLEAN);

/**
* Set to true to enable LWJGL's debug mode.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ static void printError(String message) {
* @param libFile the library file loaded
*/
private static void checkHash(Class<?> context, Path libFile, String module, String libName) {
if (!CHECKS) {
if (Configuration.DISABLE_HASH_CHECKS.get(!CHECKS)) {
return;
}

Expand Down

0 comments on commit 7b6ba7d

Please sign in to comment.