How about compiling generated C++ files into Haskell library instead of separate shared library?
Hoppy currently assumes that generated C++ files are compiled into a independent shared library (e.g. libexample.so
). But managing separate shared library requires platform knowledge and sometimes are cumbersome to do correctly.
If there aren't strong reason to do so, I think it would be nice to compile generated C++ source files into C++ gateway package library instead to eliminate the need to build separate shared library. This can be done by using Cabal hooks to add generated files to C-Sources:
or CXX-Sources:
.
I'm currently experimenting the approach.
If this change is fine, it also make it easy to merge C++ gateway package (e.g. example-cpp
) and main package (e.g. example
) into a single package to further reduce package management effort.