-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathopengl.nimble
32 lines (26 loc) · 941 Bytes
/
opengl.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
# Package
version = "1.0.1"
author = "Leonardo Mariscal"
description = "OpenGL bindings for Nim"
license = "MIT"
srcDir = "src"
skipDirs = @["tests"]
# Dependencies
requires "nim >= 1.0.0"
task gen, "Generate bindings":
exec("nim c -d:ssl -r tools/generator.nim")
task test, "Build and test bindings":
requires "nimgl@#1.0" # Please https://github.com/nim-lang/nimble/issues/482
exec("nim c -r tests/test.nim")
task testWeb, "Build and test bindings with emscripten":
# for this to work, you need emsdk on your PATH.
# first, clone https://github.com/emscripten-core/emsdk
# then run:
# ./emsdk install latest
# ./emsdk activate latest
# and then add the directories it prints out to your PATH
exec("nim c -d:emscripten tests/test.nim")
let port = "8000"
echo "Open http://localhost:" & port & "/tests/web/index.html"
let ret = gorgeEx("python3 -m http.server " & port)
echo ret.output