compilesettings: add libpath (#16997)

* compilesettings: add libpath

* add test

* changelog

* fixup

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
This commit is contained in:
Timothee Cour 2021-02-12 14:50:41 -08:00 • committed by GitHub
commit 4326f743d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 20 additions and 19 deletions

View file

@ -3,18 +3,15 @@ cmd: "nim c --nimcache:build/myNimCache --nimblePath:myNimblePath $file"
joinable: false
"""
import strutils
import std/[strutils,compilesettings]
from std/os import fileExists, `/`
import std / compilesettings
template main =
doAssert querySetting(nimcacheDir) == nimcacheDir.querySetting
doAssert "myNimCache" in nimcacheDir.querySetting
doAssert "myNimblePath" in nimblePaths.querySettingSeq[0]
doAssert querySetting(backend) == "c"
doAssert fileExists(libPath.querySetting / "system.nim")
const
nc = querySetting(nimcacheDir)
np = querySettingSeq(nimblePaths)
static:
echo nc
echo np
doAssert "myNimCache" in nc
doAssert "myNimblePath" in np[0]
doAssert querySetting(backend) == "c"
static: main()
main()