Mercurial > games > semicongine
comparison semiconginev2/core/buildconfig.nim @ 1218:56781cc0fc7c compiletime-tests
did: renamge main package
| author | sam <sam@basx.dev> |
|---|---|
| date | Wed, 17 Jul 2024 21:01:37 +0700 |
| parents | semicongine/core/buildconfig.nim@a3eb305bcac2 |
| children | 55896320c8bf |
comparison
equal
deleted
inserted
replaced
| 1217:f819a874058f | 1218:56781cc0fc7c |
|---|---|
| 1 const ENGINENAME = "semicongine" | |
| 2 | |
| 3 # checks required build options: | |
| 4 static: | |
| 5 assert compileOption("threads"), ENGINENAME & " requires --threads=on" | |
| 6 assert defined(nimPreviewHashRef), ENGINENAME & " requires -d:nimPreviewHashRef" | |
| 7 | |
| 8 if defined(release) or defined(windows): | |
| 9 assert compileOption("app", "gui"), ENGINENAME & " requires --app=gui for release builds and all windows builds" | |
| 10 | |
| 11 | |
| 12 if defined(linux): | |
| 13 assert defined(VK_USE_PLATFORM_XLIB_KHR), ENGINENAME & " requires --d:VK_USE_PLATFORM_XLIB_KHR for linux builds" | |
| 14 elif defined(windows): | |
| 15 assert defined(VK_USE_PLATFORM_WIN32_KHR), ENGINENAME & " requires --d:VK_USE_PLATFORM_WIN32_KHR for windows builds" | |
| 16 else: | |
| 17 assert false, "trying to build on unsupported platform" | |
| 18 | |
| 19 # build configuration | |
| 20 # ===================== | |
| 21 | |
| 22 # compile-time defines, usefull for build-dependent settings | |
| 23 # can be overriden with compiler flags, e.g. -d:Foo=42 -d:Bar=false | |
| 24 # pramas: {.intdefine.} {.strdefine.} {.booldefine.} | |
| 25 | |
| 26 # root of where settings files will be searched | |
| 27 # must be relative (to the directory of the binary) | |
| 28 const DEBUG* {.booldefine.} = not defined(release) | |
| 29 const CONFIGROOT* {.strdefine.}: string = "." | |
| 30 assert not isAbsolute(CONFIGROOT) | |
| 31 | |
| 32 const CONFIGEXTENSION* {.strdefine.}: string = "ini" | |
| 33 | |
| 34 # by default enable hot-reload of runtime-configuration only in debug builds | |
| 35 const CONFIGHOTRELOAD* {.booldefine.}: bool = DEBUG | |
| 36 | |
| 37 # milliseconds to wait between checks for settings hotreload | |
| 38 const CONFIGHOTRELOADINTERVAL* {.intdefine.}: int = 1000 | |
| 39 | |
| 40 # log level | |
| 41 const LOGLEVEL {.strdefine.}: string = "Warn" | |
| 42 const ENGINE_LOGLEVEL* = parseEnum[Level]("lvl" & LOGLEVEL) | |
| 43 | |
| 44 # resource bundleing settings, need to be configured per project | |
| 45 const PACKAGETYPE* {.strdefine.}: string = "exe" # dir, zip, exe | |
| 46 static: | |
| 47 assert PACKAGETYPE in ["dir", "zip", "exe"], ENGINENAME & " requires one of -d:PACKAGETYPE=dir -d:PACKAGETYPE=zip -d:PACKAGETYPE=exe" |
