On Sun, Apr 19, 2015 at 8:00 AM, Drew Wells <
drew.w...@gmail.com> wrote:
>
> I'm linking to C++ which can't be compiled by cgo. However, there is some
> support for autogenerating go code from C++ header information via SWIG. For
> that code to be useful, the C++ library needs to be compiled. Is it possible
> to use the swig features of Go build toolchain to also compile C++
> libraries?
Sorry, I'm still not sure precisely what you are asking.
Perhaps you are saying that you have some C++ files that you wrote,
and you have a SWIG interface that lets you call that C++ code from
Go, and you want the go command to compile all of that. If that is
what you want, you should put the SWIG interface in a .swigcxx file,
and put the C++ code in .cc files, and write a least one .go file, all
in some directory under GOPATH/src. Then the go tool will pass the
.swigcxx file to SWIG, it will pass the C++ files to the C++ compiler,
and pass that .go file to the Go compiler, and will pull them all
together into a single Go package that can be imported by other Go
packages.
Ian