nimcfg

Generates a Nim config file into your project.

FAQ

Why there is no array?

Nix has array but there is no way to define how to disable one item from a array.

Like we can override one attr value with lib.mkDefault, lib.mkForce, lib.mkOverride.

LICENSE NOTICE:

type

attribute set of (submodule)

example

{
  nimcfg = {
    "/nim.cfg" = {
      app = "console";
      asm = true;
      assertions = true;
      backend = "c";
      benchmarkVM = false;
      boundChecks = true;
      cc = "gcc";
      checkStyle = false;
      checks = true;
      cincludes = "DIR";
      clearNimblePath = false;
      clib = "LIBNAME";
      clibdir = "DIR";
      colors = true;
      compileOnly = false;
      cppCompileToNamespace = {
        NS = true;
      };
      cpu = "x86-64";
      debugger = "native";
      debuginfo = true;
      declaredLocs = true;
      deepcopy = true;
      define = {
        defineSomething = "your defined option";
      };
      defusages = {
        FILE,LINE,COL = true;
      };
      docCmd = "CMD";
      docInternal = true;
      docRoot = "PATH";
      docSeeSrcUrl = "URL";
      dynlibOverride = {
        SYMBOL = true;
      };
      dynlibOverrideAll = false;
      embedsrc = false;
      errorMax = 1;
      exceptions = "setjmp";
      excessiveStackTrace = false;
      excludePath = {
        PATH = false;
      };
      expandArc = {
        PROCNAME = true;
      };
      expandMacro = {
        MACRO = true;
      };
      experimental = {
        FEAT = true;
      };
      fieldChecks = true;
      filenames = "abs";
      forceBuild = true;
      genScript = true;
      hint = {
        someHint = true;
      };
      hintAsError = {
        someHint = true;
      };
      hints = true;
      hotCodeReloading = false;
      implicitStatic = true;
      import = {
        someImport = true;
      };
      include = {
        someInclude = true;
      };
      incremental = true;
      index = true;
      infChecks = true;
      legacy = {
        FEAT = true;
      };
      lib = "PATH";
      lineDir = true;
      lineTrace = true;
      listCmd = true;
      maxLoopIterationsVM = 100000;
      mm = "arc";
      multimethods = false;
      nanChecks = true;
      nimMainPrefix = "PREFIX";
      nimblePath = "PATH";
      nimcache = "PATH";
      noLinking = true;
      noMain = true;
      noNimblePath = false;
      objChecks = true;
      opt = "speed";
      os = "linux";
      out = "FILE";
      outdir = "DIR";
      overflowChecks = true;
      panics = false;
      parallelBuild = 4;
      passC = "OPTION";
      passL = "OPTION";
      path = {
        somePath = true;
      };
      processing = "dots";
      profileVM = false;
      project = true;
      putenv = {
        someKey = true;
      };
      rangeChecks = true;
      showAllMismatches = false;
      sinkInference = true;
      skipCfg = false;
      skipParentCfg = true;
      skipProjCfg = true;
      skipUserCfg = true;
      spellSuggest = 10;
      stackTrace = true;
      stackTraceMsgs = false;
      stdout = true;
      threads = true;
      tlsEmulation = false;
      trmacros = false;
      unitsep = true;
      useVersion = "1.2";
      usenimcache = true;
      verbosity = 3;
      warning = {
        someWarning = true;
      };
      warningAsError = {
        someWarning = true;
      };
      warnings = true;
    };
  };
}

default

{
  nimcfg = {};
}

nimcfg.<name>.FOOTER

Insert this at end of cfg file

type

null or strings concatenated with "\n"

example

{
  nimcfg.<name>.FOOTER = "# IM your FOOTER";
}

default

{
  nimcfg.<name>.FOOTER = "";
}

nimcfg.<name>.HEADER

Insert this at begin of cfg file

type

null or strings concatenated with "\n"

example

{
  nimcfg.<name>.HEADER = "# IM your HEADER";
}

default

{
  nimcfg.<name>.HEADER = "";
}

nimcfg.<name>.NimblePath

add a PATH for Nimble support

type

attribute set of boolean

example

{
  nimcfg.<name>.NimblePath = {
    X = true;
  };
}

default

{
  nimcfg.<name>.NimblePath = {};
}

nimcfg.<name>.app

generate a CONSOLE app|GUI app|DLL|STATIC library

type

null or one of "console", "gui", "lib", "staticlib"

example

{
  nimcfg.<name>.app = "gui";
}

default

{
  nimcfg.<name>.app = null;
}

nimcfg.<name>.asm

produce assembler code

type

null or boolean

example

{
  nimcfg.<name>.asm = true;
}

default

{
  nimcfg.<name>.asm = null;
}

nimcfg.<name>.assertions

turn assertions on|off

type

null or boolean

example

{
  nimcfg.<name>.assertions = true;
}

default

{
  nimcfg.<name>.assertions = null;
}

nimcfg.<name>.backend

sets backend to use with commands like nim doc or nim r

type

null or one of "c", "cpp", "js", "objc"

example

{
  nimcfg.<name>.backend = "js";
}

default

{
  nimcfg.<name>.backend = null;
}

nimcfg.<name>.benchmarkVM

turn benchmarking of VM code with cpuTime() on|off

type

null or boolean

example

{
  nimcfg.<name>.benchmarkVM = true;
}

default

{
  nimcfg.<name>.benchmarkVM = null;
}

nimcfg.<name>.boundChecks

turn bound checks on|off

type

null or boolean

example

{
  nimcfg.<name>.boundChecks = true;
}

default

{
  nimcfg.<name>.boundChecks = null;
}

nimcfg.<name>.cc

SYMBOL: specify the C compiler

type

null or string

example

{
  nimcfg.<name>.cc = "gcc";
}

default

{
  nimcfg.<name>.cc = null;
}

nimcfg.<name>.checks

turn all runtime checks on|off

type

null or boolean

example

{
  nimcfg.<name>.checks = true;
}

default

{
  nimcfg.<name>.checks = null;
}

nimcfg.<name>.cincludes

modify the C compiler header search PATH

type

attribute set of boolean

example

{
  nimcfg.<name>.cincludes = {
    X = true;
  };
}

default

{
  nimcfg.<name>.cincludes = {};
}

nimcfg.<name>.clearNimblePath

empty the list of Nimble package search paths

type

null or boolean

example

{
  nimcfg.<name>.clearNimblePath = true;
}

default

{
  nimcfg.<name>.clearNimblePath = null;
}

nimcfg.<name>.clib

link an additional C LIBRARY (you should omit platform-specific extensions)

type

attribute set of boolean

example

{
  nimcfg.<name>.clib = {
    X = true;
  };
}

default

{
  nimcfg.<name>.clib = {};
}

nimcfg.<name>.clibdir

modify the linker library search PATH

type

attribute set of boolean

example

{
  nimcfg.<name>.clibdir = {
    X = true;
  };
}

default

{
  nimcfg.<name>.clibdir = {};
}

nimcfg.<name>.colors

turn compiler messages coloring on|off

type

null or boolean

example

{
  nimcfg.<name>.colors = true;
}

default

{
  nimcfg.<name>.colors = null;
}

nimcfg.<name>.compileOnly

compile Nim files only; do not assemble or link

type

null or boolean

example

{
  nimcfg.<name>.compileOnly = true;
}

default

{
  nimcfg.<name>.compileOnly = null;
}

nimcfg.<name>.cppCompileToNamespace

use the provided NAMESPACE for the generated C++ code, if no namespace is provided "Nim" will be used

type

attribute set of boolean

example

{
  nimcfg.<name>.cppCompileToNamespace = {
    X = true;
  };
}

default

{
  nimcfg.<name>.cppCompileToNamespace = {};
}

nimcfg.<name>.cpu

SYMBOL: set the target processor (cross-compilation)

type

null or string

example

{
  nimcfg.<name>.cpu = "x86-64";
}

default

{
  nimcfg.<name>.cpu = null;
}

nimcfg.<name>.debugger

use native debugger (gdb)

type

null or value "native" (singular enum)

example

{
  nimcfg.<name>.debugger = "native";
}

default

{
  nimcfg.<name>.debugger = null;
}

nimcfg.<name>.debuginfo

enables debug information

type

null or boolean

example

{
  nimcfg.<name>.debuginfo = true;
}

default

{
  nimcfg.<name>.debuginfo = null;
}

nimcfg.<name>.declaredLocs

show declaration locations in messages

type

null or boolean

example

{
  nimcfg.<name>.declaredLocs = true;
}

default

{
  nimcfg.<name>.declaredLocs = null;
}

nimcfg.<name>.deepcopy

enable 'system.deepCopy' for --mm:arc|orc

type

null or boolean

example

{
  nimcfg.<name>.deepcopy = true;
}

default

{
  nimcfg.<name>.deepcopy = null;
}

nimcfg.<name>.define

Define a conditional symbol

Optionally: Define the value for that symbol, see compile time define pragmas.

Unlike other symbols that follow identifier equality of nim, define sysymbols are full case insensitive.

Example: All defined will match with -d:A_B

when defined aB:
  echo "aB"

when defined Ab:
  echo "Ab"

when defined a_b:
  echo "a_b"

Some define options

This is a list of some define options found in Nim/Nim stdlib source code.

Look at your dependency documentation to check if they define theirs own or require some of them.

And some of them should be compiler paramaters.

ie:

  • -d:consoleapp should be --app:console
  • -d:linux should be --os:linux

Most common:

Hardware:

  • avr
  • amd64
  • arm
  • arm64
  • atari
  • cpu16
  • cpu32
  • cpu64
  • e2k
  • hppa
  • hp9000
  • hp9000s300
  • hp9000s700
  • hp9000s800
  • hp9000s820
  • i386
  • ia64
  • loongarch64
  • m68k
  • mips
  • mips64
  • mips64el
  • mipsel
  • msp430
  • nintendoswitch
  • parisc
  • powerpc
  • powerpc64
  • powerpc64el
  • riscv32
  • riscv64
  • sparc
  • sparc64
  • sparcv9
  • x86
  • wasm
  • wasm32
  • nimPinToCpu

OS:

  • aix
  • amiga
  • alpha
  • android
  • android4
  • bsd
  • dmc
  • dos
  • dragonfly
  • freebsd
  • freertos
  • genode
  • haiku
  • hpux
  • ios
  • irix
  • linux
  • macos
  • macosx
  • morphos
  • netbsd
  • netware
  • openbsd
  • os2
  • osx
  • palmos
  • posix
  • qnx
  • riscos
  • standalone
  • skyos
  • solaris
  • sunos
  • unix
  • windows
  • zephyr
  • vxworks
  • kqcache (BSD)
  • SocketMaxConnections = 32 (freertos)

Compillers:

  • bcc
  • clang
  • clangcl
  • gcc
  • icc
  • icl
  • llvm_gcc
  • tcc
  • vcc
  • wcc

Languages

  • c
  • cpp
  • js
  • nimscript
  • booting
  • consoleapp
  • guiapp
  • kwin
  • nimJsMathTruncPolyfill
  • nimJsonGet
  • nimLegacyJsRound
  • nimble
  • nimconfig
  • nimdoc
  • nimsuggest
  • noCppExceptions
  • nodejs
  • vm

Lib C

  • emscripten
  • nimNoLibc
  • uClibc
  • lwip
  • lwip6
  • nimNetLite
  • ODBCVER
  • staticSqlite
  • usePcreHeader
  • nimExperimentalLinenoiseExtra

SSL

  • ssl
  • libressl
  • openssl10
  • sslVersion = ""
  • useOpenssl3 = sslVersion.startsWith('3')
  • noOpenSSLHacks
  • nimDisableCertificateValidation
  • nimTlsSize = 16000

Memory Management

  • boehmgc
  • boehmNoIntPtr
  • gcArc
  • gcOrc
  • gogc
  • nogc
  • builtinOverflow
  • gcDestructors
  • gcHooks
  • gcMarkAndSweep
  • gcRegions
  • gcUseBitvectors
  • ignoreAllocationSize
  • logGC
  • memProfiler
  • memtracker (memTracker)
  • nimAlignPragma
  • nimAllocNoUnmap
  • nimAllocPagesViaMalloc
  • nimAllocStats
  • nimArcDebug
  • nimArcIds
  • nimEmulateOverflowChecks
  • nimFixedOrc
  • nimFixedOwned
  • nimHasLentIterators
  • nimHasSinkInference
  • nimLeakDetector
  • nimMaxHeap = 0
  • nimMemAlignTiny
  • nimMinHeapPages = 128
  • nimMinHeapPages = 4
  • nimNoAllocForSSL
  • nimNoLentIterators
  • nimOwnedEnabled
  • nimPage1k
  • nimPage256
  • nimPage512
  • nimStressOrc
  • sizeofInt128
  • StandaloneHeapSize = 1024 * PageSize
  • traceArc
  • useGcAssert
  • useMalloc
  • useRealtimeGC
  • zephyrUseLibcMalloc

Threads

  • threadsafe
  • MaxDistinguishedThread = 32
  • MaxThreadPoolSize = 256
  • nimThreadStackGuard = 128
  • nimThreadStackSize = 8192
  • threadpoolWaitMs = 100

Debug

  • androidNDK
  • debugFmtDsl
  • debugHeapLinks
  • debugScanp
  • futureLogging
  • hotcodereloading
  • hotCodeReloading
  • nativeStacktrace
  • nativeStackTrace
  • nimAuditDelete
  • nimDebugDlOpen
  • nimDoesntTrackDefects
  • nimDumpAsync
  • nimFulldebug
  • nimQuirky
  • nimTracing
  • nimTrMacros
  • nimStackTraceOverride
  • nimTasksDebug
  • profiler
  • testing
  • testNimHcr
  • traceHcr

Others

  • avlcorruption and nimAvlcorruption
  • createNimHcr
  • createNimRtl
  • nimCallDepthLimit = 2000
  • globalSymbols
  • net_ipv4
  • net_ipv6
  • net_raw
  • nimBuiltinSetjmp
  • nimCoroutines
  • nimCoroutinesSetjmp
  • nimCoroutinesSetjmpBundled
  • nimCoroutinesUcontext
  • nimCorruption
  • nimCycleBreaker
  • nimDontSetUtf8CodePage
  • nimFixedForwardGeneric
  • nimHasCallsitePragma
  • nimHasCursor
  • nimHasDeclaredMagic
  • nimHasEffectsOf
  • nimHasEnforceNoRaises
  • nimHasExceptionsQuery
  • nimHasInvariant
  • nimHasIsNamedTuple
  • nimHasIterable
  • nimHasOutParams
  • nimHasStacktraceMsgs
  • nimHasStyleChecks
  • nimHasTemplateRedefinitionPragma
  • nimHasTopDownInference
  • nimHasTrace
  • nimHasUsed
  • nimHasWorkaround14720
  • nimHashOrdinalFixed
  • nimIcIntegrityChecks
  • nimImportutilsExample
  • nimInheritHandles
  • nimIntHash1
  • nimLagacyOptionsDollar
  • nimLegacyCopyFile
  • nimLegacyMacrosCollapseSymChoice
  • nimLegacyParseQueryStrict
  • nimLegacyRandomInitRand
  • nimLegacySigpipeHandler
  • nimMacrosGetNodeId
  • nimMaxDescriptorsFallback = 16000 (asynchttpserver)
  • nimNewIntegerOps
  • nimNewShared
  • nimNoArrayToString
  • nimNoGetRandom
  • nimNoQuit
  • nimNoZeroExtendMagic
  • nimOldCaseObjects
  • nimOldDlls
  • nimOldEcho
  • nimOldRelativePathBehavior
  • nimOldShiftRight
  • nimOptimizedSplitChunk
  • nimPanics
  • nimPollHasEventFds
  • nimPreviewFloatRoundtrip
  • nimPreviewHashRef
  • nimPreviewJsonutilsHoleyEnum
  • nimPreviewSlimSystem
  • nimRawSetjmp
  • nimRecursiveSpawn
  • nimSeqsV2
  • nimShallowStrings
  • nimSigSetjmp
  • nimSmokeCycles
  • nimStdSetjmp
  • nimStrictDelete
  • nimSymImplTransform
  • nimTempPathLength = 8
  • nimThinout
  • nimToOpenArrayCString
  • nimTypeNames
  • nimUnittestAbortOnError
  • nimUnittestOutputLevel = "..."
  • nimUnittestColor = "auto" (auto|on|off)
  • nimUse64BitCTime
  • nimV2
  • nimfix
  • noIntrinsicsBitOpts
  • noNimCoroutines
  • noSignalHandler
  • noUndefinedBitOpts
  • noUnidecodeTable
  • posixRealtime
  • reportMissedDeadlines
  • tempDir = "..."
  • useClone
  • useFork
  • useNimRtl
  • useShPath = "..."
  • useStdoutAsStdmsg
  • useSysAssert
  • useWinAnsi

type

attribute set of (boolean or signed integer or string)

example

{
  nimcfg.<name>.define = {
    X = "some value";
    Y = true;
    Z = 42;
    logGC = true;
    ssl = true;
  };
}

default

{
  nimcfg.<name>.define = {};
}

nimcfg.<name>.defusages

find the definition and all usages of a symbol

type

attribute set of boolean

example

{
  nimcfg.<name>.defusages = {
    X = true;
  };
}

default

{
  nimcfg.<name>.defusages = {};
}

nimcfg.<name>.docCmd

CMD: if cmd eq skip, skips runnableExamples else, runs runnableExamples with given options

type

null or string

example

{
  nimcfg.<name>.docCmd = "-d:foo --threads:on";
}

default

{
  nimcfg.<name>.docCmd = null;
}

nimcfg.<name>.docInternal

also generate documentation for non-exported symbols

type

null or boolean

example

{
  nimcfg.<name>.docInternal = true;
}

default

{
  nimcfg.<name>.docInternal = null;
}

nimcfg.<name>.docRoot

PATH: nim doc --docRoot:/foo --project --outdir:docs /foo/sub/main.nim generates: docs/sub/main.html if path eq @pkg, will use nimble file enclosing dir if path eq @path, will use first matching dir in --path if path eq @default (the default and most useful), will use best match among @pkg,@path. if these are nonexistent, will use project path

type

null or string

example

{
  nimcfg.<name>.docRoot = "/foot";
}

default

{
  nimcfg.<name>.docRoot = null;
}

nimcfg.<name>.docSeeSrcUrl

URL: activate 'see source' for doc command (see doc.item.seesrc in config/nimdoc.cfg)

type

null or string

example

{
  nimcfg.<name>.docSeeSrcUrl = "https://github.com/riinr/nim-flake-lib/";
}

default

{
  nimcfg.<name>.docSeeSrcUrl = null;
}

nimcfg.<name>.dynlibOverride

marks SYMBOL so that dynlib:SYMBOL has no effect and can be statically linked instead; symbol matching is fuzzy so that --dynlibOverride:lua matches dynlib: "liblua.so.3"

type

attribute set of boolean

example

{
  nimcfg.<name>.dynlibOverride = {
    X = true;
  };
}

default

{
  nimcfg.<name>.dynlibOverride = {};
}

nimcfg.<name>.dynlibOverrideAll

disables the effects of the dynlib pragma

type

null or boolean

example

{
  nimcfg.<name>.dynlibOverrideAll = true;
}

default

{
  nimcfg.<name>.dynlibOverrideAll = null;
}

nimcfg.<name>.embedsrc

embeds the original source code as comments in the generated output

type

null or boolean

example

{
  nimcfg.<name>.embedsrc = true;
}

default

{
  nimcfg.<name>.embedsrc = null;
}

nimcfg.<name>.errorMax

stop compilation after N errors; 0 means unlimited

type

null or unsigned integer, meaning >=0

example

{
  nimcfg.<name>.errorMax = 4;
}

default

{
  nimcfg.<name>.errorMax = null;
}

nimcfg.<name>.exceptions

select the exception handling implementation

type

null or one of "setjmp", "cpp", "goto", "quirky"

example

{
  nimcfg.<name>.exceptions = "setjmp";
}

default

{
  nimcfg.<name>.exceptions = null;
}

nimcfg.<name>.excessiveStackTrace

stack traces use full file paths

type

null or boolean

example

{
  nimcfg.<name>.excessiveStackTrace = true;
}

default

{
  nimcfg.<name>.excessiveStackTrace = null;
}

nimcfg.<name>.excludePath

exclude a PATH from the list of search paths

type

attribute set of boolean

example

{
  nimcfg.<name>.excludePath = {
    X = true;
  };
}

default

{
  nimcfg.<name>.excludePath = {};
}

nimcfg.<name>.expandArc

show how PROCNAME looks like after diverse optimizations before the final backend phase (mostly ARC/ORC specific)

type

attribute set of boolean

example

{
  nimcfg.<name>.expandArc = {
    X = true;
  };
}

default

{
  nimcfg.<name>.expandArc = {};
}

nimcfg.<name>.expandMacro

dump every generated AST from MACRO

type

attribute set of boolean

example

{
  nimcfg.<name>.expandMacro = {
    X = true;
  };
}

default

{
  nimcfg.<name>.expandMacro = {};
}

nimcfg.<name>.experimental

enable experimental language FEATURE

type

attribute set of boolean

example

{
  nimcfg.<name>.experimental = {
    X = true;
  };
}

default

{
  nimcfg.<name>.experimental = {};
}

nimcfg.<name>.fieldChecks

turn case variant field checks on|off

type

null or boolean

example

{
  nimcfg.<name>.fieldChecks = true;
}

default

{
  nimcfg.<name>.fieldChecks = null;
}

nimcfg.<name>.filenames

customize how filenames are rendered in compiler messages, defaults to abs (absolute)

type

null or one of "abs", "canonical", "legacyRelProj"

example

{
  nimcfg.<name>.filenames = "abs";
}

default

{
  nimcfg.<name>.filenames = null;
}

nimcfg.<name>.floatChecks

turn all floating point (NaN/Inf) checks on|off

type

null or boolean

example

{
  nimcfg.<name>.floatChecks = true;
}

default

{
  nimcfg.<name>.floatChecks = null;
}

nimcfg.<name>.forceBuild

force rebuilding of all modules

type

null or boolean

example

{
  nimcfg.<name>.forceBuild = true;
}

default

{
  nimcfg.<name>.forceBuild = null;
}

nimcfg.<name>.genScript

generate a compile script (in the 'nimcache' subdirectory named 'compile_$$project$$scriptext'), and a '.deps' file containing the dependencies; implies --compileOnly

type

null or boolean

example

{
  nimcfg.<name>.genScript = true;
}

default

{
  nimcfg.<name>.genScript = null;
}

nimcfg.<name>.hint

turn specific HINT X on|off. hint:X means hint:X:on, as with similar flags. all is the set of all hints (only all:off is supported).

type

attribute set of boolean

example

{
  nimcfg.<name>.hint = {
    X = true;
  };
}

default

{
  nimcfg.<name>.hint = {};
}

nimcfg.<name>.hintAsError

turn specific HINT X into an error on|off

type

attribute set of boolean

example

{
  nimcfg.<name>.hintAsError = {
    X = true;
  };
}

default

{
  nimcfg.<name>.hintAsError = {};
}

nimcfg.<name>.hints

on|off enables or disables hints. list reports which hints are selected.

type

null or boolean

example

{
  nimcfg.<name>.hints = true;
}

default

{
  nimcfg.<name>.hints = null;
}

nimcfg.<name>.hotCodeReloading

turn support for hot code reloading on|off

type

null or boolean

example

{
  nimcfg.<name>.hotCodeReloading = true;
}

default

{
  nimcfg.<name>.hotCodeReloading = null;
}

nimcfg.<name>.implicitStatic

turn implicit compile time evaluation on|off

type

null or boolean

example

{
  nimcfg.<name>.implicitStatic = true;
}

default

{
  nimcfg.<name>.implicitStatic = null;
}

nimcfg.<name>.import

add an automatically imported MODULE see also patchFile in nimscript which offers more flexibility.

type

attribute set of boolean

example

{
  nimcfg.<name>.import = {
    X = true;
  };
}

default

{
  nimcfg.<name>.import = {};
}

nimcfg.<name>.include

add an automatically included MODULE

type

attribute set of boolean

example

{
  nimcfg.<name>.include = {
    X = true;
  };
}

default

{
  nimcfg.<name>.include = {};
}

nimcfg.<name>.incremental

only recompile the changed modules (experimental!)

type

null or boolean

example

{
  nimcfg.<name>.incremental = true;
}

default

{
  nimcfg.<name>.incremental = null;
}

nimcfg.<name>.index

turn index file generation on|off

type

null or boolean

example

{
  nimcfg.<name>.index = true;
}

default

{
  nimcfg.<name>.index = null;
}

nimcfg.<name>.infChecks

turn Inf checks on|off

type

null or boolean

example

{
  nimcfg.<name>.infChecks = true;
}

default

{
  nimcfg.<name>.infChecks = null;
}

nimcfg.<name>.legacy

enable obsolete/legacy language FEATURE

type

attribute set of boolean

example

{
  nimcfg.<name>.legacy = {
    X = true;
  };
}

default

{
  nimcfg.<name>.legacy = {};
}

nimcfg.<name>.lib

PATH: set the system library path

type

null or string

example

{
  nimcfg.<name>.lib = "./my_nim";
}

default

{
  nimcfg.<name>.lib = null;
}

nimcfg.<name>.lineDir

generation of #line directive on|off

type

null or boolean

example

{
  nimcfg.<name>.lineDir = true;
}

default

{
  nimcfg.<name>.lineDir = null;
}

nimcfg.<name>.lineTrace

turn line tracing on|off

type

null or boolean

example

{
  nimcfg.<name>.lineTrace = true;
}

default

{
  nimcfg.<name>.lineTrace = null;
}

nimcfg.<name>.listCmd

list the compilation commands; can be combined with --hint:exec:on and --hint:link:on

type

null or boolean

example

{
  nimcfg.<name>.listCmd = true;
}

default

{
  nimcfg.<name>.listCmd = null;
}

nimcfg.<name>.maxLoopIterationsVM

set max iterations for all VM loops

type

null or positive integer, meaning >0

example

{
  nimcfg.<name>.maxLoopIterationsVM = 10000;
}

default

{
  nimcfg.<name>.maxLoopIterationsVM = null;
}

nimcfg.<name>.mm

select which memory management to use; default is 'refc' recommended is 'orc'

type

null or one of "orc", "arc", "refc", "markAndSweep", "boehm", "go", "none", "regions"

example

{
  nimcfg.<name>.mm = "orc";
}

default

{
  nimcfg.<name>.mm = null;
}

nimcfg.<name>.multimethods

turn multi-methods on|off

type

null or boolean

example

{
  nimcfg.<name>.multimethods = true;
}

default

{
  nimcfg.<name>.multimethods = null;
}

nimcfg.<name>.nanChecks

turn NaN checks on|off

type

null or boolean

example

{
  nimcfg.<name>.nanChecks = true;
}

default

{
  nimcfg.<name>.nanChecks = null;
}

nimcfg.<name>.nimMainPrefix

PREFIX: use {prefix}NimMain instead of NimMain in the produced C/C++ code

type

null or string

example

{
  nimcfg.<name>.nimMainPrefix = "nim_c_";
}

default

{
  nimcfg.<name>.nimMainPrefix = null;
}

nimcfg.<name>.nimcache

PATH: set the path used for generated files see also

type

null or string

example

{
  nimcfg.<name>.nimcache = "./cache";
}

default

{
  nimcfg.<name>.nimcache = null;
}

nimcfg.<name>.noLinking

compile Nim and generated files but do not link

type

null or boolean

example

{
  nimcfg.<name>.noLinking = true;
}

default

{
  nimcfg.<name>.noLinking = null;
}

nimcfg.<name>.noMain

do not generate a main procedure

type

null or boolean

example

{
  nimcfg.<name>.noMain = true;
}

default

{
  nimcfg.<name>.noMain = null;
}

nimcfg.<name>.noNimblePath

deactivate the Nimble path

type

null or boolean

example

{
  nimcfg.<name>.noNimblePath = true;
}

default

{
  nimcfg.<name>.noNimblePath = null;
}

nimcfg.<name>.objChecks

turn obj conversion checks on|off

type

null or boolean

example

{
  nimcfg.<name>.objChecks = true;
}

default

{
  nimcfg.<name>.objChecks = null;
}

nimcfg.<name>.opt

optimize not at all or for speed|size Note: use -d:release for a release build!

type

null or one of "none", "speed", "size"

example

{
  nimcfg.<name>.opt = "speed";
}

default

{
  nimcfg.<name>.opt = null;
}

nimcfg.<name>.os

SYMBOL: set the target operating system (cross-compilation)

type

null or string

example

{
  nimcfg.<name>.os = "linux";
}

default

{
  nimcfg.<name>.os = null;
}

nimcfg.<name>.out

FILE: set the output filename

type

null or string

example

{
  nimcfg.<name>.out = "my_bin";
}

default

{
  nimcfg.<name>.out = null;
}

nimcfg.<name>.outdir

DIR: set the path where the output file will be written

type

null or string

example

{
  nimcfg.<name>.outdir = "./bin";
}

default

{
  nimcfg.<name>.outdir = null;
}

nimcfg.<name>.overflowChecks

turn int over-/underflow checks on|off

type

null or boolean

example

{
  nimcfg.<name>.overflowChecks = true;
}

default

{
  nimcfg.<name>.overflowChecks = null;
}

nimcfg.<name>.panics

turn panics into process terminations (default: off)

type

null or boolean

example

{
  nimcfg.<name>.panics = true;
}

default

{
  nimcfg.<name>.panics = null;
}

nimcfg.<name>.parallelBuild

perform a parallel build value = number of processors (0 for auto-detect)

type

null or unsigned integer, meaning >=0

example

{
  nimcfg.<name>.parallelBuild = 4;
}

default

{
  nimcfg.<name>.parallelBuild = null;
}

nimcfg.<name>.passC

OPTION: pass an option to the C compiler

type

null or strings concatenated with "\n"

example

{
  nimcfg.<name>.passC = "-flto";
}

default

{
  nimcfg.<name>.passC = null;
}

nimcfg.<name>.passL

OPTION: pass an option to the linker

type

null or strings concatenated with "\n"

example

{
  nimcfg.<name>.passL = "-flto";
}

default

{
  nimcfg.<name>.passL = null;
}

nimcfg.<name>.path

add PATH to search paths

type

attribute set of boolean

example

{
  nimcfg.<name>.path = {
    X = true;
  };
}

default

{
  nimcfg.<name>.path = {};
}

nimcfg.<name>.processing

show files as they're being processed by nim compiler

type

null or one of "dots", "filenames", "off"

example

{
  nimcfg.<name>.processing = "filenames";
}

default

{
  nimcfg.<name>.processing = null;
}

nimcfg.<name>.profileVM

turn compile time VM profiler on|off

type

null or boolean

example

{
  nimcfg.<name>.profileVM = true;
}

default

{
  nimcfg.<name>.profileVM = null;
}

nimcfg.<name>.project

document the whole project (doc)

type

null or boolean

example

{
  nimcfg.<name>.project = true;
}

default

{
  nimcfg.<name>.project = null;
}

nimcfg.<name>.putenv

set an environment variable

type

attribute set of string

example

{
  nimcfg.<name>.putenv = {
    LANG = "en_US.UTF-8";
    X = "some value";
  };
}

default

{
  nimcfg.<name>.putenv = {};
}

nimcfg.<name>.rangeChecks

turn range checks on|off

type

null or boolean

example

{
  nimcfg.<name>.rangeChecks = true;
}

default

{
  nimcfg.<name>.rangeChecks = null;
}

nimcfg.<name>.showAllMismatches

show all mismatching candidates in overloading resolution

type

null or boolean

example

{
  nimcfg.<name>.showAllMismatches = true;
}

default

{
  nimcfg.<name>.showAllMismatches = null;
}

nimcfg.<name>.sinkInference

turn sink parameter inference on|off (default: on)

type

null or boolean

example

{
  nimcfg.<name>.sinkInference = true;
}

default

{
  nimcfg.<name>.sinkInference = null;
}

nimcfg.<name>.skipCfg

do not read the nim installation's configuration file

type

null or boolean

example

{
  nimcfg.<name>.skipCfg = true;
}

default

{
  nimcfg.<name>.skipCfg = null;
}

nimcfg.<name>.skipParentCfg

do not read the parent dirs' configuration files

type

null or boolean

example

{
  nimcfg.<name>.skipParentCfg = true;
}

default

{
  nimcfg.<name>.skipParentCfg = null;
}

nimcfg.<name>.skipProjCfg

do not read the project's configuration file

type

null or boolean

example

{
  nimcfg.<name>.skipProjCfg = true;
}

default

{
  nimcfg.<name>.skipProjCfg = null;
}

nimcfg.<name>.skipUserCfg

do not read the user's configuration file

type

null or boolean

example

{
  nimcfg.<name>.skipUserCfg = true;
}

default

{
  nimcfg.<name>.skipUserCfg = null;
}

nimcfg.<name>.spellSuggest

show at most num >= 0 spelling suggestions on typos. if num is not specified (or auto), return an implementation defined set of suggestions.

type

null or positive integer, meaning >0

example

{
  nimcfg.<name>.spellSuggest = 10;
}

default

{
  nimcfg.<name>.spellSuggest = null;
}

nimcfg.<name>.stackTrace

turn stack tracing on|off

type

null or boolean

example

{
  nimcfg.<name>.stackTrace = true;
}

default

{
  nimcfg.<name>.stackTrace = null;
}

nimcfg.<name>.stackTraceMsgs

enable user defined stack frame msgs via setFrameMsg

type

null or boolean

example

{
  nimcfg.<name>.stackTraceMsgs = true;
}

default

{
  nimcfg.<name>.stackTraceMsgs = null;
}

nimcfg.<name>.stdout

output to stdout

type

null or boolean

example

{
  nimcfg.<name>.stdout = true;
}

default

{
  nimcfg.<name>.stdout = null;
}

nimcfg.<name>.styleCheck

produce hints or errors for Nim identifiers that do not adhere to Nim's official style guide. styleCheck:usages - only enforce consistent spellings of identifiers, do not enforce the style on declarations

type

null or one of "off", "hint", "error", "usages"

example

{
  nimcfg.<name>.styleCheck = "hint";
}

default

{
  nimcfg.<name>.styleCheck = null;
}

nimcfg.<name>.threads

turn support for multi-threading on|off

type

null or boolean

example

{
  nimcfg.<name>.threads = true;
}

default

{
  nimcfg.<name>.threads = null;
}

nimcfg.<name>.tlsEmulation

turn thread local storage emulation on|off

type

null or boolean

example

{
  nimcfg.<name>.tlsEmulation = true;
}

default

{
  nimcfg.<name>.tlsEmulation = null;
}

nimcfg.<name>.trmacros

turn term rewriting macros on|off

type

null or boolean

example

{
  nimcfg.<name>.trmacros = true;
}

default

{
  nimcfg.<name>.trmacros = null;
}

nimcfg.<name>.undef

undefine a conditional SYMBOL

type

attribute set of boolean

example

{
  nimcfg.<name>.undef = {
    X = true;
  };
}

default

{
  nimcfg.<name>.undef = {};
}

nimcfg.<name>.unitsep

use the ASCII unit separator (31) between error messages, useful for IDE-like tooling

type

null or boolean

example

{
  nimcfg.<name>.unitsep = true;
}

default

{
  nimcfg.<name>.unitsep = null;
}

nimcfg.<name>.useVersion

emulate Nim version X of the Nim compiler, for testing

type

null or one of "1.0", "1.2"

example

{
  nimcfg.<name>.useVersion = "1.2";
}

default

{
  nimcfg.<name>.useVersion = null;
}

nimcfg.<name>.usenimcache

will use $$nimcache, whichever it resolves to after all options have been processed

type

null or boolean

example

{
  nimcfg.<name>.usenimcache = true;
}

default

{
  nimcfg.<name>.usenimcache = null;
}

nimcfg.<name>.verbosity

set Nim's verbosity level (1 is default)

type

null or one of 0, 1, 2, 3

example

{
  nimcfg.<name>.verbosity = 3;
}

default

{
  nimcfg.<name>.verbosity = null;
}

nimcfg.<name>.warning

turn on|off WARNING

type

attribute set of boolean

example

{
  nimcfg.<name>.warning = {
    X = true;
  };
}

default

{
  nimcfg.<name>.warning = {};
}

nimcfg.<name>.warningAsError

turn some WARNING in ERROR

type

attribute set of boolean

example

{
  nimcfg.<name>.warningAsError = {
    X = true;
  };
}

default

{
  nimcfg.<name>.warningAsError = {};
}

nimcfg.<name>.warnings

same as --hints but for warnings.

type

null or boolean

example

{
  nimcfg.<name>.warnings = true;
}

default

{
  nimcfg.<name>.warnings = null;
}