specialpaths.nim 947 B

1234567891011121314151617181920212223242526272829303132
  1. #[
  2. todo: move findNimStdLibCompileTime, findNimStdLib here
  3. ]#
  4. import os
  5. # Note: all the const paths defined here are known at compile time and valid
  6. # so long Nim repo isn't relocated after compilation.
  7. # This means the binaries they produce will embed hardcoded paths, which
  8. # isn't appropriate for some applications that need to be relocatable.
  9. const sourcePath = currentSourcePath()
  10. # robust way to derive other paths here
  11. # We don't depend on PATH so this is robust to having multiple nim
  12. # binaries
  13. const nimRootDir* = sourcePath.parentDir.parentDir.parentDir.parentDir
  14. ## root of Nim repo
  15. const stdlibDir* = nimRootDir / "lib"
  16. # todo: make nimeval.findNimStdLibCompileTime use this
  17. const systemPath* = stdlibDir / "system.nim"
  18. const buildDir* = nimRootDir / "build"
  19. ## refs #10268: all testament generated files should go here to avoid
  20. ## polluting .gitignore
  21. static:
  22. # sanity check
  23. doAssert fileExists(systemPath)