Support for Windows cross-compilation from Linux (#295)

Since `DirSep` matches the default separator of the target OS, it's
not suitable for performing path operations during compile-time on
the host OS.

The particular fix here solves the issue for cross-compiling a Windows
build from a Linux host, but Nim seems to need a more general solution
for detecting the host OS during compilation, so a host OS specific
separator can be used in paths derived from `currentSourcePath`.
This commit is contained in:
zah 2023-04-28 13:31:44 +03:00 committed by GitHub
parent f014ea44a5
commit 37048e87de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -5,14 +5,14 @@
import
std/[strformat, strutils]
from os import DirSep
from os import DirSep, AltSep
const
# FIELD_ELEMENTS_PER_BLOB is overrideable from
# compiler switch -d: or --define:
FIELD_ELEMENTS_PER_BLOB* {.intdefine.} = 4096
# kzgPath: c-kzg-4844 project path, removing 3 last elem
kzgPath = currentSourcePath.rsplit(DirSep, 3)[0] & "/"
kzgPath = currentSourcePath.rsplit({DirSep, AltSep}, 3)[0] & "/"
blstPath = kzgPath & "blst/"
srcPath = kzgPath & "src/"
bindingsPath = blstPath & "bindings"