Source Edit

This module allows querying the compiler about diverse configuration settings. See also compileOption.

Types

  1. MultipleValueSetting {.pure.} = enum
  2. nimblePaths, ## the nimble path(s)
  3. searchPaths, ## the search path for modules
  4. lazyPaths, ## experimental: even more paths
  5. commandArgs, ## the arguments passed to the Nim compiler
  6. cincludes, ## the #include paths passed to the C/C++ compiler
  7. clibs ## libraries passed to the C/C++ compiler

settings resulting in a seq of string values Source Edit

  1. SingleValueSetting {.pure.} = enum
  2. arguments, ## experimental: the arguments passed after '-r'
  3. outFile, ## experimental: the output file
  4. outDir, ## the output directory
  5. nimcacheDir, ## the location of the 'nimcache' directory
  6. projectName, ## the project's name that is being compiled
  7. projectPath, ## experimental: some path to the project that is being compiled
  8. projectFull, ## the full path to the project that is being compiled
  9. command, ## experimental: the command (e.g. 'c', 'cpp', 'doc') passed to
  10. ## the Nim compiler
  11. commandLine, ## experimental: the command line passed to Nim
  12. linkOptions, ## additional options passed to the linker
  13. compileOptions, ## additional options passed to the C/C++ compiler
  14. ccompilerPath, ## the path to the C/C++ compiler
  15. backend, ## the backend (eg: c|cpp|objc|js); both `nim doc --backend:js`
  16. ## and `nim js` would imply backend=js
  17. libPath, ## the absolute path to the stdlib library, i.e. nim's `--lib`, since 1.5.1
  18. gc {....deprecated.}, ## gc selected
  19. mm ## memory management selected

settings resulting in a single string value Source Edit

Procs

  1. proc querySetting(setting: SingleValueSetting): string {.compileTime,
  2. noSideEffect, ...raises: [], tags: [], forbids: [].}

Can be used to get a string compile-time option.

See also:

Example:

  1. const nimcache = querySetting(SingleValueSetting.nimcacheDir)

Source Edit

  1. proc querySettingSeq(setting: MultipleValueSetting): seq[string] {.compileTime,
  2. noSideEffect, ...raises: [], tags: [], forbids: [].}

Can be used to get a multi-string compile-time option.

See also:

Example:

  1. const nimblePaths = querySettingSeq(MultipleValueSetting.nimblePaths)

Source Edit