Merge pull request #2 from timotheecour/pr_fix_for_windows
fix for windows for CT FFI
This commit is contained in:
commit
99183ed84f
3 changed files with 15 additions and 7 deletions
|
|
@ -108,7 +108,7 @@
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#ifndef _MSC_VER
|
#ifndef _MSC_VER
|
||||||
#include <unistd.h>
|
//#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,14 @@
|
||||||
{.deadCodeElim: on.}
|
{.deadCodeElim: on.}
|
||||||
|
|
||||||
when defined(windows):
|
when defined(windows):
|
||||||
|
import os
|
||||||
# on Windows we don't use a DLL but instead embed libffi directly:
|
# on Windows we don't use a DLL but instead embed libffi directly:
|
||||||
{.pragma: mylib, header: r"ffi.h".}
|
|
||||||
|
const thisPath = currentSourcePath.parentDir
|
||||||
|
const flag = "-I" & (thisPath / "common") & " -I" & thisPath
|
||||||
|
{.passC: flag.}
|
||||||
|
|
||||||
|
{.pragma: mylib, header: r"common/ffi.h".}
|
||||||
|
|
||||||
#{.compile: r"common\malloc_closure.c".}
|
#{.compile: r"common\malloc_closure.c".}
|
||||||
{.compile: r"common\raw_api.c".}
|
{.compile: r"common\raw_api.c".}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,11 @@
|
||||||
[Package]
|
# Package
|
||||||
name = "libffi"
|
version = "1.0.1"
|
||||||
version = "1.0.0"
|
|
||||||
author = "Andreas Rumpf"
|
author = "Andreas Rumpf"
|
||||||
description = "libffi wrapper for Nim."
|
description = "libffi wrapper for Nim."
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|
||||||
[Deps]
|
when defined(windows):
|
||||||
Requires: "nim >= 0.10.0"
|
installExt = @["nim", "c", "h", "s"]
|
||||||
|
|
||||||
|
# Dependencies
|
||||||
|
requires "nim >= 0.10.0"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue