LVGL is compiled fully every time I compile an example:
nim c -r ex18_styles_to_parts_states.nim
Hint: used config file '/home/jose/.choosenim/toolchains/nim-1.6.10/config/nim.cfg' [Conf]
Hint: used config file '/home/jose/.choosenim/toolchains/nim-1.6.10/config/config.nims' [Conf]
Hint: used config file '/home/jose/src/nimlang/lvgl.nim/examples/config.nims' [Conf]
.............................................................................................
/home/jose/src/nimlang/lvgl.nim/examples/ex18_styles_to_parts_states.nim(3, 11) Warning: imported and not used: 'streams' [UnusedImport]
CC: lv_font_montserrat_30
CC: lv_font_montserrat_46
CC: lv_font_montserrat_28_compressed
CC: lv_font_montserrat_12_subpx
CC: lv_font
...
The reason is that the library is inteded to be embeded in the binary itself (and that is the reason behind compiles.nim).
One option would be creating a library (dynamic or static).
But I was wondering if I could compile each file during the library installation; maybe with nimble leaving the .o files within the nimble folder structure.
But later, how I could link those files to the binary. Any {.passL.} flag? Maybe with gorge ?
LVGL is compiled fully every time I compile an example:
Is it?
https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-compile-pragma
"Note: Nim computes a SHA1 checksum and only recompiles the file if it has changed."
In my case is not behaving in a consistent manner. Sometimes it recompiles just the corresponding modified file, but others it recompiles everything.
I am not sure if the issue has to do with the fact that I am jumping from one example to another.
From what I see, first the ".o" files are created for each example under ~/.cache/nim. Probably in my case would be better to compile all those into the same folder and then to use {.link: "".} instead of compile.
Does this makes sense?
I have created a lvgl.nimble with a task that stores the nimcache outcomes within the nimble structure.
Later I include a file with the {.link: "xxx.c.o"}. This way there is no need to compile the whole library for each new example.
It is a bit crappy, but it seems to work.