Fixes and test lzma/zlib with ast2

This commit is contained in:
Ganesh Viswanathan 2020-05-01 15:07:51 -05:00
commit 748998b0bd
6 changed files with 85 additions and 74 deletions

View file

@ -14,7 +14,7 @@ proc testCall(cmd, output: string, exitCode: int, delete = true) =
doAssert outp.contains(output), outp
var
cmd = "nim c -f --hints:off"
cmd = "nim c -f --hints:off -d:FLAGS=\"-f:ast2\""
lrcmd = " -r lzma.nim"
zrcmd = " -r zlib.nim"
lexp = "liblzma version = "

View file

@ -3,8 +3,10 @@ import os, strutils
import nimterop/[build, cimport]
const
FLAGS {.strdefine.} = ""
baseDir = getProjectCacheDir("nimterop" / "tests" / "liblzma")
flags = "--prefix=___,__,_ --suffix=__,_"
tflags = "--prefix=___,__,_ --suffix=__,_ " & FLAGS
static:
cSkipSymbol(@[
@ -38,8 +40,8 @@ cOverride:
lzma_index_iter = object
when not lzmaStatic:
cImport(lzmaPath, recurse = true, dynlib = "lzmaLPath", flags = flags)
cImport(lzmaPath, recurse = true, dynlib = "lzmaLPath", flags = tflags)
else:
cImport(lzmaPath, recurse = true, flags = flags)
cImport(lzmaPath, recurse = true, flags = tflags)
echo "liblzma version = " & $lzma_version_string()

View file

@ -1,6 +1,8 @@
import os, nimterop/[cimport, build]
const
FLAGS {.strdefine.} = ""
baseDir = getProjectCacheDir("nimterop" / "tests" / "soloud")
incl = baseDir/"include"
src = baseDir/"src"
@ -42,7 +44,6 @@ cCompile(src/"audiosource", "cpp", exclude="ay/")
cCompile(src/"audiosource", "c")
cCompile(src/"filter/*.cpp")
const FLAGS {.strdefine.} = ""
cImport(incl/"soloud_c.h", flags = FLAGS)
var

View file

@ -3,6 +3,8 @@ import os, strutils
import nimterop/[build, cimport]
const
FLAGS {.strdefine.} = ""
baseDir = getProjectCacheDir("nimterop" / "tests" / "zlib")
proc zlibPreBuild(outdir, path: string) =
@ -64,8 +66,8 @@ when zlibGit or zlibDL:
cIncludeDir(baseDir / "buildcache")
when not zlibStatic:
cImport(zlibPath, recurse = true, dynlib = "zlibLPath")
cImport(zlibPath, recurse = true, dynlib = "zlibLPath", flags = FLAGS)
else:
cImport(zlibPath, recurse = true)
cImport(zlibPath, recurse = true, flags = FLAGS)
echo "zlib version = " & $zlibVersion()