haskell-game / dear-imgui.hs

Haskell bindings to Dear ImGui, an immediate mode GUI toolkit
BSD 3-Clause "New" or "Revised" License
142 stars 31 forks source link

Adding debug mode to build #104

Closed jpwidera closed 3 years ago

jpwidera commented 3 years ago

To debug the C/C++-calls and run in gdb a debug mode would be very handsome. Something like:

if flag(debug)
  if os(linux)
     ghc-options: -Wall -g -rtsopts -dcore-lint -debug -O0
     cc-options: -g -O0 -fsanitize=address -fno-omit-frame-pointer
  if os(darwin)
    ....
  if os(windows)
   ...
ocharles commented 3 years ago

Sounds good to me!

jpwidera commented 3 years ago

As far as I can see, there are no "free" variables in cabal. Therefore this decision tree has to be repeated for each module. Does anyone know any trick? Otherwise I will create a PR with copy and paste-sections.

dpwiz commented 3 years ago

Try this https://cabal.readthedocs.io/en/latest/cabal-package.html#common-stanzas

dpwiz commented 3 years ago

@jpwidera Is the issue resolved with compiler flags merged?

jpwidera commented 3 years ago

Yes! :)