aboutsummaryrefslogtreecommitdiff
path: root/nimterop.nimble
blob: 8e27d8e071122aef3e3e89ce0dec1cbfb4403216 (plain)
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Package

version     = "0.2.0"
author      = "genotrance"
description = "C/C++ interop for Nim"
license     = "MIT"

# this gives Warning: Binary 'nimterop/toast' was already installed from source directory
# when running `nimble install --verbose -y`
bin = @["nimterop/toast"]
installDirs = @["nimterop"]
installFiles = @["config.nims"]

# Dependencies
requires "nim >= 0.19.2", "regex >= 0.10.0", "cligen >= 0.9.17"

import nimterop/docs

proc execCmd(cmd: string) =
  echo "execCmd:" & cmd
  exec cmd

proc execTest(test: string) =
  execCmd "nim c -f -r " & test
  execCmd "nim cpp -r " & test

task buildToast, "build toast":
  execCmd("nim c -f -d:danger nimterop/toast.nim")

task bt, "build toast":
  execCmd("nim c -d:danger nimterop/toast.nim")

task docs, "Generate docs":
  buildDocs(@["nimterop/all.nim"], "build/htmldocs")

task test, "Test":
  buildToastTask()

  execTest "tests/tnimterop_c.nim"
  execCmd "nim cpp -f -r tests/tnimterop_cpp.nim"
  execTest "tests/tpcre.nim"

  # Platform specific tests
  when defined(Windows):
    execTest "tests/tmath.nim"
  if defined(OSX) or defined(Windows) or not existsEnv("TRAVIS"):
    execTest "tests/tsoloud.nim"

  # getHeader tests
  withDir("tests"):
    execCmd("nim e getheader.nims")

  docsTask()