changeset 504:f83f59d6f889

add: correct publishing dir, correct check when nimcheck is running
author Sam <sam@basx.dev>
date Wed, 18 Jan 2023 14:43:07 +0700
parents 4c723f56f860
children dec40cc6df6f
files config.nims src/semicongine/shader.nim
diffstat 2 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/config.nims	Wed Jan 18 14:15:47 2023 +0700
+++ b/config.nims	Wed Jan 18 14:43:07 2023 +0700
@@ -102,7 +102,7 @@
   exec(&"rm -rf {BUILDBASE}")
 
 task publish, "publish all build":
-  exec("rsync -rv build/ basx.dev:/var/www/public.basx.dev/zamikongine")
+  exec("rsync -rv build/ basx.dev:/var/www/public.basx.dev/semcongine")
 
 task glslangValidator, "Download glslangValidator (required for linux compilation)":
   let dirname="/tmp/glslang_download"
--- a/src/semicongine/shader.nim	Wed Jan 18 14:15:47 2023 +0700
+++ b/src/semicongine/shader.nim	Wed Jan 18 14:43:07 2023 +0700
@@ -33,6 +33,8 @@
   of VK_SHADER_STAGE_ALL: ""
 
 proc compileGLSLToSPIRV(stage: static VkShaderStageFlagBits, shaderSource: static string, entrypoint: string): seq[uint32] {.compileTime.} =
+  when defined(nimcheck): # will not run if nimcheck is running
+    return result
   const
     stagename = stage2string(stage)
     shaderHash = hash(shaderSource)
@@ -43,8 +45,6 @@
   let (output, exitCode_glsl) = gorgeEx(command=fmt"{projectPath}/glslangValidator --entry-point {entrypoint} -V --stdin -S {stagename} -o {shaderout}", input=shaderSource)
   if exitCode_glsl != 0:
     raise newException(Exception, output)
-  if output == "": # this happens when the nim was invoked with "check" instead of "compile/c", as it prevents the gorgeEx command to really run. However, there is hope, see https://github.com/nim-lang/RFCs/issues/430
-    return result
   let shaderbinary = staticRead shaderout
 
   let (output_rm, exitCode_rm) = gorgeEx(command=fmt"rm {shaderout}")