Add windows libffi.dll and remove old code

This commit is contained in:
Joey Yakimowich-Payne 2020-02-06 20:45:43 -07:00
commit bdb2b7fa25
24 changed files with 5 additions and 7212 deletions

View file

@ -11,36 +11,15 @@
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: