planetis-m / naylib

Yet another raylib Nim wrapper
MIT License
227 stars 10 forks source link

Split into modules and costumize the build #55

Closed planetis-m closed 1 year ago

planetis-m commented 1 year ago

Customization options:

SUPPORT_MODULE_RSHAPES
SUPPORT_MODULE_RTEXTURES
...

defined in CompileDefinitions.cmake

planetis-m commented 1 year ago

Problem: I can pass {.passC: "-DSUPPORT_TEXT_MANIPULATION=0 -DSUPPORT_MODULE_RTEXT=0".} to disable that module but to have it opt-in when raylib/rtext is imported one needs to edit config.h Also dependencies between them might make that impossible "RTEXT requires SUPPORT_MODULE_RTEXTURES to load sprite font textures". might not even worth it.

planetis-m commented 1 year ago

Options can also be passed from users code.

planetis-m commented 1 year ago

Works but requires editing config.h ... The biggest issue it needs an reorg.

raylib/
  prelude.nim <- to be included
  types.nim
  rcore.nim
  rshapes.nim
  rtext.nim
  rtextures.nim
  rmodels.nim
  raudio.nim
  dist/raylib/ <- raylib repo
planetis-m commented 1 year ago

Problem: Breaks the script, how know which functions go to each module (programmatically). Guess I need to make up list. I don't think it's worth it. Only raudio which is also standalone may benefit. Executable sizes is not a big of an issue for such a massive undertaking especially since a bare minimal apk is just 740kB.

planetis-m commented 1 year ago

Not worth the time or effort.