This is how I implemented it in picostdlib:

<https://github.com/EmbeddedNim/picostdlib/blob/master/src/piconim.nim#L102>

Works for me on linux and windows using choosenim. It should find the "lib" 
directory (containing the nimbase.h file) that is associated with the "nim" 
binary currently on the path.

But PMunch's comment actually makes me realize it might not work with OS 
package managers. I'll have to try that. I wonder if we could add a 
`getCurrentCompilerLibPath` proc to Nim, that works like 
`getCurrentCompilerExe()`. Or extract the include paths from the compiler 
command lines produced by Nim. Are those in the json file produced in nimcache? 
Hm.

Reply via email to