I'm trying to get:
nimble build
to run with some switches
task build, "Build task":
echo "running build task"
setCommand "c"
--define:useRealtimeGC
--app:lib
--path:host
but they aren't applying.
I can put these switches in a config.nims, but I want to know how can I get the above to work? What is difference in the way configuration files (nim.cfg), nimscript (config.nims), and nimble are used?
What is the difference in the way configuration files (nim.cfg), nimscript (config.nims), and nimble are used?
The difference resides in the set of bugs you have to deal with ;)
Normally people pick either nim.cfg or config.nims (I choose the latter). It boils down to preference.
You can use config.nims with the nimble packages too. I choose to put only the stuff needed by nimble in the .nimble files.
Benefit of this approach:
I did notice a bug report about a flags working in .cfg vs .nims, and I realized that build wasn't meant to be overridden but the reason is unclear to me. Trying to tease apart the godot-nim bindings I noticed all three ways were used for configuration where .cfg had no logic in them.
I know you can use the @if / @else in .cfg files, but .nims seems more suited for most things. I tried including --path in .cfg and .nims which works fine if I run nimble and exec nim, but when I run nimble and exec nimble it's not picked up even though the config file is read, so I had to include --path as a flag to the exec nimble call.
For example in gonim.nimble:
I'm calling nimble in nimble because I have a dependency on the compiler module, and the dependency check is only triggered when I exec nimble. Is there a way to trigger the dependency check with nimble without having to call nimble build or having to parse nimble list -i or nimble install compiler -n?