In a custom cabal hook I generated object files (*.o) which I want to pass to the linker. How do I do this idiomatically?
Solution Don Stewart's answer goes in the right direction. Currently I do the following:
$ runhaskell Setup.lhs build --ld-options="PATHS TO .o FILES"
According to the Cabal documentation for UserHooks, it looks like you'll need to add a buildHook, by specifying additional build flags, that add your .o files to the buildFlags for ld.
As an aside, you should be aware that generating custom .o files is highly unusual, and likely to make your build fragile. Is there a particular reason why Cabal is unable to generate these .o files itself?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With