Closed brianonn closed 5 years ago
You should simply put nim.cfg
in your project folder, specifying the additional flags there. nim check
will use them as well as other nim
commands. We would like to provide actual compilation results with nim check
, and if someone compiles without --threads:on
using the threads module is an error.
@endragor ah, ok. good point. I didn't realize that nim check
would use the compiler flags from the cfg file too. Using the cfg file is a better, more general solution and I will close this PR then.
Cheers !
test with the following code snippet:
You get the following errors without this small patch:
when the patch is applied, the checker understands the threadpool classes:
The patch is simple and adds
--threads:on
to the check command. Since threads:on was introduced over 4 years ago and it's not harmful to leave it on the command line even when not using threads, I would consider this a safe fix.However, an improvement would be to use a workspace configuration variable (maybe something like nim.checkFlags` ) for supplying additional flags to the check command.