forked from facebook/yoga
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.ts
44 lines (34 loc) · 804 Bytes
/
build.ts
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
// run with
// deno run --allow-all build.js
console.log("Build starting...")
console.log(`Current OS: ${Deno.build.os}`)
Deno.mkdir("build").catch(() => {});
if (Deno.build.os === "windows") {
await winBuild();
} else {
await otherBuild();
}
async function winBuild() {
const p = Deno.run({
cmd: ["cmake", "-DCMAKE_CXX_COMPILER=cl.exe -A x64", ".."],
cwd: "build"
});
await p.status();
const p2 = Deno.run({
cmd: ["cmake", "--build", ".", "--", "/property:Configuration=Release"],
cwd: "build"
});
await p2.status();
}
async function otherBuild() {
const p = Deno.run({
cmd: ["cmake", "-G Ninja", ".."],
cwd: "build"
});
await p.status();
const p2 = Deno.run({
cmd: ["cmake", "--build", ".", "--config", "Release"],
cwd: "build"
});
await p2.status();
}