nx-go
nx-go copied to clipboard
Allow to set buildmode
Hi! I am integrating Go code in my codebase and exposing its functions in a shared library file (.so). It would be nice to be able to set the buildmode, like in my case c-shared, or c-archive for example. There's no hurry in my case, in the meantime I've made my own builder, based on this library.
Hi @toverux, could you provide an example of the command that would be used to set this build mode?
Hello, sorry I didn't respond back then.
I was simply passing the -buildmode c-shared
option to build a shared library (.so/.dll) useable from another program (in my case Node.js with FFI). So, not an app, but the build process is the same except for just this option!
Ex: go build -o awesome.so -buildmode=c-shared awesome.go
See : https://github.com/vladimirvivien/go-cshared-examples