version       = "0.0.1"
author        = "Otanoe"
description   = "zzz"
license       = "ZZZ"
srcDir        = "src"
bin           = @["shapes"]

requires "nim >= 1.4.8"
requires "freetype"
#requires "chronos"
requires "glm"
requires "winim"

#nim c -d:danger --gc:orc --cc:clang --passC:"-flto" --passL:"-flto" -d:useMalloc #(?) 

#why does it not execute
task dbg_prof_malloc, "build & run debug binary":
  exec "nim c -r --hints:off --warnings:off --nimcache:nim_cache --gc:orc --threads:on -d:useMalloc --stackTrace:on --profiler:on --outdir:bin src/shapes.nim"

task dbg_malloc, "build & run debug binary":
  exec "nim c -r --hints:off --warnings:off --nimcache:nim_cache --gc:orc --threads:on -d:useMalloc --stackTrace:on --outdir:bin src/shapes.nim"

task dbg, "build & run debug binary":
  exec "clear && nim c -r --hints:off --warnings:off --nimcache:/run/media/j/ZZZ/Dev/nim/cache --gc:orc --threads:on --outdir:bin src/shapes.nim"

task dbg_win, "build & run debug binary":
  exec "nim c -r --hints:off --warnings:off --gc:arc --threads:off --stackTrace:on --lineTrace:on  --checks:on -d:useMalloc --nimcache:E:/Programming/nim/cache --outdir:bin src/shapes.nim"

task buildrun, "build & run debug binary":
 exec "nim c -r --hints:off --nimcache:/run/media/j/ZZZ/Dev/nim/cache --gc:orc --outdir:bin src/shapes.nim"

task redbg, "force-rebuild & run debug binary":
 exec "nim c -r -f --hints:off --warnings:off --nimcache:/run/media/j/ZZZ/Dev/nim/cache --gc:orc --threads:on -d:useMalloc --outdir:bin src/shapes.nim"

task rerel, "force-rebuild & run debug binary":
 exec "nim c -r -f --hints:off --warnings:off --nimcache:/run/media/j/ZZZ/Dev/nim/cache --gc:orc --threads:on -d:useMalloc -d:danger --passC:\"-flto\" --passL:\"-flto\" --outdir:bin src/shapes.nim"

task run, "run debug binary":
 exec "nim -r bin/shapes"

task tests, "run all tests":
 exec "nim c -r tests/vkTests/"

task vkTests, "Make sure vulkan is working properly":
 echo "vkInstance: In progress..."
 exec "nim c -r --hints:off tests/vkTests/instance"

task w64, "windows build":
 exec "nim c -r -f --hints:off --warnings:off --nimcache:F:/nimcache --gc:orc --outdir:bin src/shapes.nim"
# task build-LREL, "build & run Linux release binary":
#  exec "nim c -r -f -d:release --hints:off --nimcache:/run/media/j/ZZZ/Dev/nim/cache src/shapes.nim"

task help, "list all tasks":
 echo "buildrun  build & run debug binary"
 echo "dbg       build & run debug binary"
 echo "redbg     rebuild everything & run debug binary"
 echo "rerel     rebuild everything & run release binary"
 echo "run       build & run debug binary in bin"
 echo "tests     run all tests"
 echo "vkTests   run basic but core vulkan functionality"
 echo "w64       rebuild and run win64 binary"
#task bench "benchmarking 
# exec