Hi there!
Currently I compile my program with
nim c -d:ssl --threads:on app.nim
I also have an {.experimental.} pragma inside app.nim which I assume could be replaced with another flag to the compiler.
Right now I'm a bit confused about these flags and parameters`. <https://bibliocrunch.com/profile/techcaredn/>`_
Is there a pattern for when the parameter to the compiler should have no dash (c/compile) one dash (-d:ssl) or two dashes (--threads:on)? Can all these parameters be replaced with pragmas in the code? Is it possible to keep the compiler options in a nim.cfg file? I still haven't found a help section about configuration files that explains what they can do. Thanks
Command line parameters follow Unix conventions, one hyphen (minus) for one letter options like -d:release, two hyphens for multiletter options like --threads:on.
See "nim --fullhelp" for a list of all (documented) command line parameters.
path:"$projectdir"
nimcache:"/tmp/$projectdir"
gcc.options.speed = "-march=native -O3 -flto -fstrict-aliasing"
#gcc.options.speed = "-save-temps -march=native -O3 -fstrict-aliasing"
#gcc.options.speed = "-march=native -O3 -g -fno-strict-aliasing"
-d:ssl
This is same with --define:ssl , two hyphens is long option while single hyphen is short option.
This --define option is to define a compile-time variable ala #DEFINE in C
for example you define 'goThisWay' when compiling then you can use it in code
when defined(goThisWay):
# all codes that will be compiled
else:
# alternative when you want other codes
Another use is explained in this part of manual