x/mobile: Building the framework for OSX #13310
Comments
Sorry, supporting non-mobile operating systems is not a goal right now for gomobile. It would be nice to see gobind generally supported for OS X one day, but there's significant work to be done. |
Damn. I was hoping I could just compile a library for x86 using Alternatively, can you briefly outline what would need to be done? |
I believe an OS X framework can be dynamically loaded, which is different from iOS and not yet supported. So what the gomobile tool is doing will not generate a framework for OS X. @hyangah reminded me today that in its current state, gobind can be used on OS X. But you have to statically link the generated code into your C program. You can try building a .a file with go build -buildmode=c-archive. Have a read through https://github.com/golang/mobile/blob/master/bind/objc/test.bash. |
With that simple commit https://github.com/bclermont/mobile/commit/27e1b66f2aabbd2abe32bd8cf7e316cb9f9f9371 I switched from iPhone simulator to OSX to build a Using https://github.com/bclermont/mobile/commit/27e1b66f2aabbd2abe32bd8cf7e316cb9f9f9371#commitcomment-16297002 I could remove the iOS binary. Then, this @crawshaw I think it's a simple change that could add to |
Using
gomobile bind
I'm able to build my go package into a framework for iOS. I would like to do this for OSX as well. I tried working aroundgomobile
and creating a library using justgo build
but I get warnings that-linkshared is only supported on linux/amd64
. Also tried setting ARCH and OS flags, didn't seem to affectgomobile
.I would like to put together a script that compiles both frameworks at once. Is such a thing possible using just
gomobile
? Can I build the library on linux and move it to OSX?The text was updated successfully, but these errors were encountered: