EmbeddedNim / picostdlib

Nim wrapper for the raspberry pi stdlib
MIT License
70 stars 11 forks source link

Move some hardcoded compiler flags to a nim.cfg file #44

Closed auxym closed 2 years ago

auxym commented 2 years ago

See: https://github.com/beef331/picostdlib/blob/b1bae1b47f7f0057f3973f2a330fb90c9d116bd2/src/piconim.nim#L21

Library users might want to override some of these flags. Eg. running a debug or danger build instead of release, or ORC instead of ARC. I therefore propose to add a nim.cfg file to the template that specifies these flags, and remove the hardcoded values in piconim. The flags that are "absolutely necessary" for a working build should probably stay where they are (--cpu, --nimcache, useMalloc).

This once again breaks backwards compatibility with previously created projects (sorry). Users that want to upgrade would need to copy the new nim.cfg file in their project.

Thoughts?

beef331 commented 2 years ago

config.nims is what I'd prefer nim.cfg is for local overrides in my view. I'm not too worried about previous projects given this is not an overly used library I would wager. piconim is versioned along side the stdlib, so it's not a major painpoint, just pin to the previos version.