This repository has been archived by the owner on Jul 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
windowssdk.nimble
56 lines (44 loc) · 1.94 KB
/
windowssdk.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# Package
packageName = "windowssdk"
version = "10.0.17134.0"
author = "Fredrik Høisæther Rasch"
description = "Windows SDK nimble package"
license = "MIT"
srcDir = "src"
# Dependencies
requires "https://github.com/fredrikhr/nim-importc-helpers.git >= 1.0"
requires "nim >= 1.0"
import strutils
# Setup
before debugbuild:
mkDir "bin"
before debugbuildWithSdk:
mkDir "bin"
before test:
mkDir "bin"
before testWithSdk:
mkDir "bin"
task docall, "Document srcDir recursively":
proc recurseDir(srcDir, docDir: string, nimOpts: string = "") =
for srcFile in listFiles(srcDir):
if not srcFile.endsWith(".nim"):
echo "skipping non nim file: $#" % [srcFile]
continue
let docFile = docDir & srcFile[srcDir.len..^5] & ".html"
echo "file: $# -> $#" % [srcFile, docFile]
exec "nim doc2 $# -o:\"$#\" \"$#\"" % [nimOpts, docFile, srcFile]
for srcSubDir in listDirs(srcDir):
let docSubDir = docDir & srcSubDir[srcDir.len..^1]
# echo "dir: $# -> $#" % [srcSubDir, docSubDir]
mkDir docSubDir
recurseDir(srcSubDir, docSubDir)
let docDir = "doc"
recurseDir(srcDir, docDir)
task debugbuild, "Builds the Windows SDK bundle":
exec "nim compile -o:bin/windowssdk --nimcache:obj src/windowssdk"
task debugbuildWithSdk, "Builds the Windows SDK bundle":
exec "nim compile -o:bin/windowssdk --nimcache:obj -d:useWinSdk --dynlibOverride:Secur32.dll --dynlibOverride:SspiCli.dll --dynlibOverride:CredUi.dll --dynlibOverride:ole32.dll --passL:Secur32.lib --passL:Ole32.lib src/windowssdk"
task test, "Runs the test module":
exec "nim compile -r -o:bin/twindowssdk --nimcache:obj test/twindowssdk"
task testWithSdk, "Runs the test module":
exec "nim compile -r -o:bin/twindowssdk --nimcache:obj -d:useWinSdk --dynlibOverride:Secur32.dll --dynlibOverride:SspiCli.dll --dynlibOverride:CredUi.dll --dynlibOverride:ole32.dll --passL:Secur32.lib --passL:Ole32.lib test/twindowssdk"