add mm to compilesettings; deprecate gc (#19394)

This commit is contained in:
flywind 2022-01-17 04:10:35 +08:00 • committed by GitHub
commit 15e3813d96
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 2 deletions

View file

@ -135,6 +135,7 @@ when defined(nimHasInvariant):
of backend: result = $conf.backend
of libPath: result = conf.libpath.string
of gc: result = $conf.selectedGC
of mm: result = $conf.selectedGC
proc querySettingSeqImpl(conf: ConfigRef, switch: BiggestInt): seq[string] =
template copySeq(field: untyped): untyped =

View file

@ -32,7 +32,8 @@ type
backend ## the backend (eg: c|cpp|objc|js); both `nim doc --backend:js`
## and `nim js` would imply backend=js
libPath ## the absolute path to the stdlib library, i.e. nim's `--lib`, since 1.5.1
gc ## gc selected
gc {.deprecated.} ## gc selected
mm ## memory management selected
MultipleValueSetting* {.pure.} = enum ## \
## settings resulting in a seq of string values

View file

@ -1,5 +1,5 @@
discard """
cmd: "nim c --nimcache:build/myNimCache --nimblePath:myNimblePath $file"
cmd: "nim c --nimcache:build/myNimCache --nimblePath:myNimblePath --gc:arc $file"
joinable: false
"""
@ -12,6 +12,7 @@ template main =
doAssert "myNimblePath" in nimblePaths.querySettingSeq[0]
doAssert querySetting(backend) == "c"
doAssert fileExists(libPath.querySetting / "system.nim")
doAssert querySetting(mm) == "arc"
static: main()
main()