Skip to content

Allow config if to auto load native libraries with -Dswift-java.auto-load-libraries=false #364

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 15, 2025

Conversation

ktoso
Copy link
Collaborator

@ktoso ktoso commented Aug 15, 2025

This way we can disable the automatic loading of libraries by passing -Dswift-java.auto-load-libraries=false to the jvm.

We may also consider a runtime API to do this?

// Ensure Swift and our Lib are loaded during static initialization of the class.
SwiftLibraries.loadLibrary("swiftCore");
SwiftLibraries.loadLibrary("SwiftKitSwift");
SwiftLibraries.loadLibrary(LIB_NAME);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The SwiftLibraries load was "overdoing it" a bit.

@ktoso ktoso merged commit e29deed into swiftlang:main Aug 15, 2025
110 of 114 checks passed
@ktoso ktoso deleted the wip-loading-libs branch August 15, 2025 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant