Description
High level
Our team has grand aspirations of using Go as the common language between several projects (ios, android, windows, mac). Gomobile has filled the first two quite nicely and -buildmode=c-archive looks like what we'd want for windows/mac. Additionally, our library embeds sqlite3 and, thus, needs cgo.
Goal
The windows projects have a dll-based loader, that patches and loads dlls independently. We want to make our go-library's functionality available in these dlls.
Problem
We were able to build the static library on windows using mingw/msys, but it doesn't use the same cl.exe compiler that VS2013 (yes, it's old) uses to build the dlls. Are there any supported ways to build a static library using CC=VS2013? The exported cgo methods would then be adapted to dll methods.
Workaround
The workaround we use (which is certainly not ideal, and, also, not sellable to the windows team) is to build a small REST server with our go code and tie in the launching/closing of this process via the windows dll. Clearly we could use some other IPC/RPC to talk to this server, but we don't want to have to do that.
Question
Is there a cleaner build/strategy that would allow us to use go(and c via cgo) code in these windows dlls?
Thanks!
Matt
Metadata
Metadata
Assignees
Type
Projects
Status