How do you dynamically load a module on Linux?


(Edward Connell) #1

On OSX my application loads a bundle from the PlugIns directory. It loads
and executes perfectly.

Now I'm painfully trying to port my code to Linux, where we don't seem to
have frameworks or bundles per se. I assumed a bundle is just a dynamic lib
or module. My build creates a PlugIns directory and copies the plugins
.swiftmodule and .swiftdoc files into that directory hoping the load api
would work.

When I call

Bundle.paths(forResourcesOfType: "swiftmodule", inDirectory: dir)

I get zero results. I'm not even sure if this is heading in the right
direction.

How do I dynamically load a module on Linux?

Thanks, Ed


Is it possible to load an SPM framework/dylib at runtime under Linux