-
Notifications
You must be signed in to change notification settings - Fork 0
/
miho.nimble
36 lines (28 loc) · 974 Bytes
/
miho.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
import strutils
# Package
version = "0.0.0"
author = "Nelson Crosby"
description = "Desktop remote control"
license = "BSD2"
srcDir = "src"
binDir = "build"
# Dependencies
requires "nim >= 0.18.0"
requires "https://github.com/NelsonCrosby/nim-cbor >= 0.2.2"
when defined(windows):
requires "winim >= 2.5"
task buildCli, "build command-line driver":
let cachedir = nimcacheDir().replace("_d", "miho_d")
let exename = toExe "miho"
mkDir "build"
exec "nim c --app:" & apptype & " --out:build/" & exename & " src/bin/miho.nim"
proc buildType(apptype: string) =
let cachedir = nimcacheDir().replace("_d", "shared_d")
let header = cachedir & "/shared.h"
let dllname = toDll "miho"
mkDir "build"
exec "nim c --app:" & apptype & " --out:build/" & dllname & " --header src/miho/shared.nim"
rmFile "build/miho-driver.h"
mvFile header, "build/miho-driver.h"
task buildShared, "build shared library":
buildType "lib"