This repository has been archived by the owner on Feb 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
project.clj
90 lines (79 loc) · 2.89 KB
/
project.clj
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
(require 'leiningen.core.eval)
;; per-os jvm-opts code cribbed from Overtone
(def JVM-OPTS
{:common []
:macosx ["-XstartOnFirstThread" "-Djava.awt.headless=true"]
:linux []
:windows []})
(defn jvm-opts
"Return a complete vector of jvm-opts for the current os."
[] (let [os (leiningen.core.eval/get-os)]
(vec (set (concat (get JVM-OPTS :common)
(get JVM-OPTS os))))))
(def LWJGL_NS "org.lwjgl")
;; Edit this to change the version.
(def LWJGL_VERSION "3.1.5")
;; Edit this to add/remove packages.
(def LWJGL_MODULES ["lwjgl"
"lwjgl-assimp"
"lwjgl-bgfx"
"lwjgl-egl"
"lwjgl-glfw"
"lwjgl-jawt"
"lwjgl-jemalloc"
"lwjgl-lmdb"
"lwjgl-lz4"
"lwjgl-nanovg"
"lwjgl-nfd"
"lwjgl-nuklear"
"lwjgl-odbc"
"lwjgl-openal"
"lwjgl-opencl"
"lwjgl-opengl"
"lwjgl-opengles"
"lwjgl-openvr"
"lwjgl-par"
"lwjgl-remotery"
"lwjgl-rpmalloc"
"lwjgl-sse"
"lwjgl-stb"
"lwjgl-tinyexr"
"lwjgl-tinyfd"
"lwjgl-tootle"
"lwjgl-vulkan"
"lwjgl-xxhash"
"lwjgl-yoga"
"lwjgl-zstd"])
;; It's safe to just include all native dependencies, but you might
;; save some space if you know you don't need some platform.
(def LWJGL_PLATFORMS ["linux" "macos" "windows"])
;; These packages don't have any associated native ones.
(def no-natives? #{"lwjgl-egl" "lwjgl-jawt" "lwjgl-odbc"
"lwjgl-opencl" "lwjgl-vulkan"})
(defn lwjgl-deps-with-natives []
(apply concat
(for [m LWJGL_MODULES]
(let [prefix [(symbol LWJGL_NS m) LWJGL_VERSION]]
(into [prefix]
(if (no-natives? m)
[]
(for [p LWJGL_PLATFORMS]
(into prefix [:classifier (str "natives-" p)
:native-prefix ""]))))))))
(def all-dependencies
(into ;; Add your non-LWJGL dependencies here
'[[org.clojure/clojure "1.9.0"]
[org.joml/joml "1.9.7"]
[org.l33tlabs.twl/pngdecoder "1.0"]]
(lwjgl-deps-with-natives)))
(defproject yaw "0.2.0"
:description "A simple 3D programming world."
:url "https://github.com/fredokun/yaw"
:license {:name "The MIT License"
:url "http://opensource.org/licenses/MIT"}
:dependencies ~all-dependencies
:min-lein-version "2.1.0"
:jvm-opts ^:replace ~(jvm-opts)
:source-paths ["src/clojure" "examples"]
:java-source-paths ["src/java"]
:test-paths ["test" "src/test"])