Merge pull request #6 from jyapayne/add_windows_dll

Add windows libffi.dll and remove old code
This commit is contained in:
Andreas Rumpf 2021-08-24 08:13:16 +02:00 • committed by GitHub
commit 153322d744
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 5 additions and 7212 deletions

View file

@ -13,36 +13,15 @@ when defined(nimHasStyleChecks):
when defined(windows):
import os
# on Windows we don't use a DLL but instead embed libffi directly:
const thisPath = currentSourcePath.parentDir
const flag = "-I" & (thisPath / "common") & " -I" & thisPath
{.passc: flag.}
const libPath = currentSourcePath.parentDir / "libs"
{.pragma: mylib, header: r"common/ffi.h".}
#{.compile: r"common\malloc_closure.c".}
{.compile: r"common\raw_api.c".}
when defined(vcc):
{.compile: r"msvc\ffi.c".}
{.compile: r"msvc\prep_cif.c".}
{.compile: r"msvc\win32.c".}
{.compile: r"msvc\types.c".}
when defined(cpu64):
{.compile: r"msvc\win64_asm.asm".}
else:
{.compile: r"msvc\win32_asm.asm".}
when defined(cpu64):
const arch = "win64"
else:
{.compile: r"gcc\ffi.c".}
{.compile: r"gcc\prep_cif.c".}
{.compile: r"gcc\types.c".}
{.compile: r"gcc\closures.c".}
when defined(cpu64):
{.compile: r"gcc\ffi64.c".}
{.compile: r"gcc\win64_asm.S".}
else:
{.compile: r"gcc\win32_asm.S".}
const arch = "win32"
{.pragma: mylib, dynlib: libPath / arch / "libffi-7.dll".}
elif defined(macosx):
{.pragma: mylib, dynlib: "libffi.dylib".}
else: