cross-compile with latest MXE (#22)

This commit is contained in:
Ștefan Talpalaru 2022-03-22 16:04:03 +01:00 committed by GitHub
parent 284b3aac05
commit 656881b721
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 8 deletions

View File

@ -21,26 +21,28 @@ when defined(nimStackTraceOverride) and defined(nimHasStacktracesModule):
# there, but we might still want to import this module with a global
# "--import:libbacktrace" Nim compiler flag.
when not (defined(nimscript) or defined(js)):
import algorithm, libbacktrace_wrapper, os, system/ansi_c
import algorithm, libbacktrace_wrapper, os, system/ansi_c, strutils
const installPath = currentSourcePath.parentDir() / "install" / "usr"
const
topLevelPath = currentSourcePath.parentDir().replace('\\', '/')
installPath = topLevelPath & "/install/usr"
{.passc: "-I" & currentSourcePath.parentDir().}
{.passc: "-I" & topLevelPath.}
when defined(cpp):
{.passl: installPath / "lib" / "libbacktracenimcpp.a".}
{.passl: installPath & "/lib/libbacktracenimcpp.a".}
else:
{.passl: installPath / "lib" / "libbacktracenim.a".}
{.passl: installPath & "/lib/libbacktracenim.a".}
when defined(libbacktraceUseSystemLibs):
{.passl: "-lbacktrace".}
when defined(macosx) or defined(windows):
{.passl: "-lunwind".}
else:
{.passc: "-I" & installPath / "include".}
{.passl: installPath / "lib" / "libbacktrace.a".}
{.passc: "-I" & installPath & "/include".}
{.passl: installPath & "/lib/libbacktrace.a".}
when defined(macosx) or defined(windows):
{.passl: installPath / "lib" / "libunwind.a".}
{.passl: installPath & "/lib/libunwind.a".}
when defined(windows):
{.passl: "-lpsapi".}