changeset 387:cbd59b758ef6

fix: move switches into our engine-build-func
author Sam <sam@basx.dev>
date Sun, 03 Dec 2023 01:48:55 +0700
parents 31f8ecc6644c
children 405bb1fb52b8
files semicongine/build.nim
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/semicongine/build.nim	Sun Dec 03 01:02:42 2023 +0700
+++ b/semicongine/build.nim	Sun Dec 03 01:48:55 2023 +0700
@@ -1,11 +1,13 @@
 import std/strformat
 import std/os
 
-proc semicongine_build*(buildType: string, bundleType: string, resourceRoot="resources", builddir="./build"): string =
+proc semicongine_build*(buildname: string, bundleType: string, resourceRoot: string, builddir="./build"): string =
   switch("experimental", "strictEffects")
   switch("experimental", "strictFuncs")
   switch("define", "nimPreviewHashRef")
 
+  switch("define", &"BUNDLETYPE={bundleType}")
+  switch("define", &"RESOURCEROOT={resourceRoot}")
 
   var platformDir = "unkown"
   if defined(linux):
@@ -15,7 +17,7 @@
     switch("define", "VK_USE_PLATFORM_WIN32_KHR")
     platformDir = "windows"
 
-  var outdir = builddir / buildType / platformDir / projectName()
+  var outdir = builddir / buildname / platformDir / projectName()
   switch("outdir", outdir)
   setCommand "c"
   rmDir(outdir)