-
Notifications
You must be signed in to change notification settings - Fork 12
/
nimLUA.nimble
39 lines (33 loc) · 1.11 KB
/
nimLUA.nimble
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
packageName = "nimLUA"
version = "0.3.8"
author = "Andri Lim"
description = "glue code generator to bind Nim and Lua together using Nim's powerful macro"
license = "MIT"
skipDirs = @["test", "scripts"]
requires: "nim >= 1.2.2"
### Helper functions
proc test(env, path: string) =
# Compilation language is controlled by TEST_LANG
var lang = "c"
if existsEnv"TEST_LANG":
lang = getEnv"TEST_LANG"
debugEcho "LANG: ", lang
when defined(unix):
const libm = "-lm"
else:
const libm = ""
when defined(macosx):
# nim bug, incompatible pointer assignment
# see nim-lang/Nim#16123
if lang == "cpp":
lang = "c"
if not dirExists "build":
mkDir "build"
exec "nim " & lang & " " & env &
" --outdir:build -r --hints:off --warnings:off " &
" -d:lua_static_lib --passL:\"-Lexternal -llua " & libm & " \" " & path
task test, "Run all tests":
test "-d:nimDebugDlOpen", "tests/test_features"
test "-d:nimDebugDlOpen -d:release", "tests/test_features"
test "-d:importLogging", "tests/test_bugfixes"
test "-d:importLogging -d:release", "tests/test_bugfixes"