That I am less certain about. I don't think that the LSP uses the swiftmodule to provide completion but rather relies on the source indexing to provide that. I might be completely wrong on that part, but without teaching SK-LSP about deserialising the swiftmodule, I don't think that it would provide completion.
Yeah, I thought so. That defeats the whole purpose of static libs.
Is there any other way to link to my engine code without having to see the sources ?
Currently, I am building a dynamic lib and declare all public engine APIs with _cdecl which isn't really optimal.
You do not need to see the sources to link to the code. But you will need that for the completion through SourceKit-LSP. You could generate documentation and ship that along with the libraries to enable the use of the library.