diff src/glslang/glslang_c_interface.nim @ 2:213fdf8d31dd

did: hello world triangle, a bit of code organization
author Sam <sam@basx.dev>
date Mon, 19 Dec 2022 10:41:20 +0700
parents bb2a7d3a7003
children 0660ba9d1930
line wrap: on
line diff
--- a/src/glslang/glslang_c_interface.nim	Fri Dec 16 00:05:41 2022 +0700
+++ b/src/glslang/glslang_c_interface.nim	Mon Dec 19 10:41:20 2022 +0700
@@ -1,9 +1,20 @@
-# required to link the GLSL compiler
+import std/strformat
+
+when defined(linux):
+  const platform = "linux"
+when defined(windows):
+  const platform = "windows"
+
+
 when defined(release):
-  {.passl: "-Lthirdparty/glslang/lib/release" .}
+  const libversion = "release"
 else:
-  {.passl: "-Lthirdparty/glslang/lib/debug" .}
-{.passl: "-Lthirdparty/spirv-tools/lib/" .}
+  const libversion = "debug"
+
+
+# required to link the GLSL compiler
+{.passl: &"-Lthirdparty/lib/glslang/{platform}_{libversion}" .}
+{.passl: &"-Lthirdparty/lib/spirv-tools/{platform}_{libversion}" .}
 
 {.passl: "-lglslang" .}
 {.passl: "-lglslang-default-resource-limits" .}
@@ -14,7 +25,6 @@
 {.passl: "-lOGLCompiler" .}
 {.passl: "-lSPIRV" .}
 {.passl: "-lSPIRV-Tools-opt" .}
-
 {.passl: "-lSPIRV-Tools" .}
 {.passl: "-lSPIRV-Tools-diff" .}
 {.passl: "-lSPIRV-Tools-fuzz" .}