forked from janet-lang/jaylib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproject.janet
57 lines (46 loc) · 1.57 KB
/
project.janet
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
57
( declare-project
:name "jaylib"
:description "Janet bindings to Raylib"
:url "https://github.com/janet-lang/jaylib"
:author "Calvin Rose <[email protected]>")
(def o (os/which))
(def cflags
(case o
:macos '["-Iraylib/src" "-ObjC" "-Iraylib/src/external/glfw/include"]
:windows ["-Iraylib/src" "-Iraylib/src/external/glfw/include" ]
#default
'["-Iraylib/src" "-Iraylib/src/external/glfw/include"]))
(def lflags
(case o
:windows '["user32.lib" "gdi32.lib" "winmm.lib" "shell32.lib"]
:macos '["-lpthread" "-framework" "Cocoa" "-framework" "CoreVideo" "-framework" "IOKit" "-framework" "OpenGL"]
:linux '["-lpthread" "-lX11"]
#default
'["-lpthread"]))
(declare-native
:name "jaylib"
:cflags [;default-cflags ;cflags]
:defines {"PLATFORM_DESKTOP" true "_POSIX_C_SOURCE" "200809L" "_DARWIN_C_SOURCE" (if (= o :macos) "1" nil)}
:source ["src/main.c"
# raylib sources
"raylib/src/rcore.c"
"raylib/src/rmodels.c"
"raylib/src/raudio.c"
"raylib/src/rglfw.c"
"raylib/src/rshapes.c"
"raylib/src/rtext.c"
"raylib/src/rtextures.c"
"raylib/src/utils.c"]
:headers ["src/core.h"
"src/types.h"
"src/audio.h"
"src/gestures.h"
"src/text.h"
"src/image.h"
"src/shapes.h"
"src/3d.h"
"src/rlgl.h"]
:lflags [;default-lflags ;lflags])
# `jpm run repl` to run a repl with access to jaylib
(phony "repl" ["build"]
(os/execute ["janet" "-l" "build/jaylib"] :p))