changeset 397:ce66095e19e3

fix: bad way to do build config
author Sam <sam@basx.dev>
date Tue, 26 Dec 2023 21:12:14 +0700
parents c94db8b83040
children 194f0a398141
files semicongine/core/buildconfig.nim semicongine/core/constants.nim
diffstat 2 files changed, 5 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/semicongine/core/buildconfig.nim	Tue Dec 26 19:13:58 2023 +0700
+++ b/semicongine/core/buildconfig.nim	Tue Dec 26 21:12:14 2023 +0700
@@ -1,16 +1,8 @@
-import std/parsecfg
-import std/streams
 import std/strutils
 import std/logging
 import std/os
 
-const ENGINENAME* = "semicongine"
-const ENGINEVERSION* = static:
-  let nimblePath = currentSourcePath.parentDir().parentDir().parentDir().joinPath("semicongine.nimble")
-  let nimbleFile = newStringStream(staticRead(nimblePath))
-  let config = loadConfig(nimbleFile)
-  config.getSectionValue("", "version")
-
+import ./constants
 
 # checks required build options:
 static:
--- a/semicongine/core/constants.nim	Tue Dec 26 19:13:58 2023 +0700
+++ b/semicongine/core/constants.nim	Tue Dec 26 21:12:14 2023 +0700
@@ -1,1 +1,4 @@
-const RESOURCEROOT*: string = "resources"
+const
+  RESOURCEROOT*: string = "resources"
+  ENGINENAME* = "semicongine"
+  ENGINEVERSION* = "0.0.1"