t15955.nim 515 B

1234567891011121314151617181920212223
  1. discard """
  2. joinable: false
  3. """
  4. import stdtest/specialpaths
  5. import std/[osproc, strformat, os]
  6. const
  7. nim = getCurrentCompilerExe()
  8. buildLib = buildDir / "libD20220923T19380"
  9. currentDir = splitFile(currentSourcePath).dir
  10. file = currentDir / "m15955.nim"
  11. main = currentDir / "m15955_main.nim"
  12. proc runCmd(cmd: string) =
  13. let (msg, code) = execCmdEx(cmd)
  14. doAssert code == 0, msg
  15. runCmd fmt"{nim} c -o:{buildLib} --nomain --nimMainPrefix:libA -f --app:staticlib {file}"
  16. runCmd fmt"{nim} c -r {main}"