fix #62 (toast now addressed relatively); macros=>procs + other fixes (#70)

* fixes https://github.com/genotrance/nimterop/issues/62
*  toast is now automatically built on demand, and doesn't depend on PATH
- [ ] todo: need to track its deps properly to trigger rebuilding it; using same algo as shown here https://github.com/genotrance/nimterop/issues/69 but using nim deps instead of c deps
* many other fixes
  * trying to follow https://github.com/timotheecour/vitanim/wiki/Nim-best-practices
This commit is contained in:
Timothee Cour 2019-01-29 21:06:26 -08:00 • committed by genotrance
commit 839c4007f6
15 changed files with 173 additions and 108 deletions

View file

@ -67,9 +67,11 @@ s1.field1 = 5
s2.field1 = 6
s3.field1 = 7
s4.field2[2] = 5
# note: simplify with `defined(c)` for nim >= 0.19.9
when defined(cpp):
discard # TODO
else: # TODO: what's `defined(cpp)` for c ?
discard
else:
s4.field3[3] = enum1
s5.tci = test_call_int
@ -92,9 +94,9 @@ check test_call_int() == 5
check test_call_param(5).field1 == 5
check test_call_param2(5, s2).field1 == 11
check test_call_param3(5, s1).field1 == 10
# error: assigning to 'enum ENUM' from incompatible type 'NI' (aka 'long long')
when defined(cpp):
discard # TODO
# error: assigning to 'enum ENUM' from incompatible type 'NI' (aka 'long long')
discard
else:
check test_call_param4(e) == e2
check test_call_param5(5.0).field2 == 5.0
@ -103,7 +105,6 @@ u.field1 = 4
check test_call_param7(u) == 4
when defined(cpp):
# TODO
# note: candidate function not viable: no known conversion from 'NI *' (aka 'long long *') to 'int *' for 1st argument
# check test_call_param8(cast[ptr int](addr i)) == 25.0
discard

View file

@ -1,10 +1,12 @@
import os, nimterop/[cimport, git]
import os, nimterop/[cimport, git, paths]
const
incl = "soloud/include"
src = "soloud/src"
baseDir = nimteropBuildDir()/"soloud"
incl = baseDir/"include"
src = baseDir/"src"
gitPull("https://github.com/jarikomppa/soloud", "soloud", "include/*\nsrc/*\n")
static:
gitPull("https://github.com/jarikomppa/soloud", baseDir, "include/*\nsrc/*\n")
cDebug()
cDisableCaching()
@ -50,4 +52,4 @@ when declared(WavStream_stop):
assert "WavStream_stop() not skipped"
when declared(WavStream_setFilter):
assert "WavStream_setFilter not skipped"
assert "WavStream_setFilter not skipped"