There are errors with gcc.exe not able to find the required paths (original issue https://github.com/greenfork/nimraylib_now/issues/38):
gcc.exe: error: User.nimble\pkgs\nimraylib_now-0.13.1\csources\raylib_mangled: No such file or directory
where this path is fetched via (full code https://github.com/greenfork/nimraylib_now/blob/master/src/nimraylib_now/raylib_build_static.nim#L15)
# src/filenames.nim
from os import `/`, parentDir
const
srcDir* = currentSourcePath().parentDir()
cSourcesDir* = srcDir/"csources"
raylibMangledCSourcesDir* = cSourcesDir/"raylib_mangled"
# src/nimraylib_now/raylib_build_static.nim
from os import parentDir, relativePath, `/`
import ../filenames
const
CurrentDirectory = currentSourcePath().parentDir()
RaylibSrcPath = raylibMangledCSourcesDir
RaylibSrcPathRelative = relativePath(RaylibSrcPath, CurrentDirectory) # This one is the path from error
the error says that RaylibSrcPathRelative is not a valid directory.
What's up with User.nimble, where's the slash? How do I even debug this? Others have no problems on Windows. Is there any particular information I could ask to resolve this?
You can see parameters passed from Nim to gcc by adding --listcmd option when you run Nim.
You can echo a value of RaylibSrcPath or CurrentDirectory at compile time by using static statement. That might help for debug.
For example, add static statement like this to src/nimraylib_now/raylib_build_static.nim after the const section:
import sugar
const
CurrentDirectory = currentSourcePath().parentDir()
RaylibSrcPath = raylibMangledCSourcesDir
RaylibSrcPathRelative = relativePath(RaylibSrcPath, CurrentDirectory)
static:
dump CurrentDirectory
dump RaylibSrcPath