rules_swift
rules_swift copied to clipboard
How to build shared libraries using rule_swift (.so)?
I’m having trouble compiling Swift code into a shared library using rule_swift(.so). I’ve tried many methods, but none of them have worked. Is rule_swift still not supported for this purpose? Are there any other ways to achieve this? Thank you for your answer
right now there isn't a swift rule for this https://github.com/bazelbuild/rules_swift/issues/7, if you're building for apple platforms you can use a rule from rules_apple to build a dynamic framework
right now there isn't a swift rule for this #7, if you're building for apple platforms you can use a rule from rules_apple to build a dynamic framework
Thank you very much for your response. So, if I am on a Linux platform and want to compile a .so file, do I have to extend swift_binary myself, similar to how cc_binary works?
Yes, I think a change like that would be best
Yes, I think a change like that would be best
OK, I understand now, thanks again :)
Just curious if some progress has been made on shared library support?
Documentation might need to be corrected, as currently it shows "linkstatic ... Set to False
to build a .so
or .dll
. "
No progress, you're right, that doc only applies to windows at the moment I believe, I'm not actually sure if setting linkstatic = False
even on windows produces something valid