-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.nims
31 lines (25 loc) · 1023 Bytes
/
config.nims
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
# begin Nimble config (version 2)
import os, strutils
var clangPath = findExe("clang")
if "/nix/store" in clangPath:
let
packageDir = clangPath.replace("/bin/clang", "")
cflagsFilePath = packageDir & "/nix-support/libc-cflags"
cflagsContent = readFile(cflagsFilePath)
sysIncludeDir = cflagsContent.split(" ")[1]
clangIncludeDir = packageDir & "/resource-root/include"
echo "sys include path: " & sysIncludeDir
echo "clang include path: " & clangIncludeDir
switch("define", "quichenim.SysPathSystem=" & sysIncludeDir)
switch("define", "quichenim.SysPathClang=" & clangIncludeDir)
--noNimblePath
when withDir(thisDir(), system.fileExists("nimble.paths")):
include "nimble.paths"
var staticLib = "libquiche.a"
when(defined(windows)):
staticLib = "libquiche.lib"
when(defined(quichenim.UseDynamicLinking)):
switch("define", "quichenim.PassL=-L./src/quichenim/artifacts -lquiche")
else:
switch("define", "quichenim.PassL=./src/quichenim/artifacts/" & staticLib)
# end Nimble config