-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild.ts
More file actions
33 lines (29 loc) · 947 Bytes
/
build.ts
File metadata and controls
33 lines (29 loc) · 947 Bytes
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
import * as ffigen from "@glebbash/deno-ffigen";
using _ = ffigen.tmpChdir(import.meta.dirname!);
if (Deno.args.includes("-d")) {
await ffigen.extractSymbolDefinitions({
input: "input/llvm-c.h",
output: "input/llvm-c.json",
});
}
if (Deno.args.includes("-s")) {
await ffigen.extractExposedSymbols({
input: "/usr/lib/llvm-14/lib/libLLVM.so",
output: "input/llvm-c_symbols.txt",
});
}
await ffigen.generateBindings({
libName: "LLVM",
libPrefix: "LLVM",
symbolsFile: "input/llvm-c.json",
exposedSymbolsFile: "input/llvm-c_symbols.txt",
headersLocationMap: {
"/data/input/./":
"https://github.com/llvm/llvm-project/blob/release/14.x/llvm/include/",
"/usr/include/llvm-c/":
"https://github.com/llvm/llvm-project/blob/release/14.x/llvm/include/llvm-c/",
"/usr/include/llvm/":
"https://github.com/llvm/llvm-project/blob/release/14.x/llvm/include/llvm/",
},
outputFolder: "lib",
});