-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproject.msc
80 lines (70 loc) · 4.25 KB
/
project.msc
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
(define-module (substratic engine)
(import (mesche fs)
(mesche build)
(mesche string)
(mesche process)
(mesche project)
(mesche platform)))
(define (c-flags prefix web?)
(string-append prefix
"-I" (path-resolve "./include") " "
"-I./src/spng/ "
"-I./src/cglm/ "
"-I./src/glad/include "
(if web?
"-sUSE_GLFW=3 -sUSE_FREETYPE=1 -sUSE_ZLIB=1 -sMIN_WEBGL_VERSION=2 -sMAX_WEBGL_VERSION=2"
(string-append (string-append (string-trim (pkg-config "glfw3" :exclude-libs #t))
" "
(string-trim (pkg-config "fontconfig" :exclude-libs #t)))))))
(define (c-libs web?)
(if web?
"-lm -lz"
(string-append "-lm -ldl -lz "
(string-trim (pkg-config "glfw3" :exclude-cflags #t)) " "
(string-trim (pkg-config "gl" :exclude-cflags #t)) " "
(string-trim (pkg-config "fontconfig" :exclude-cflags #t)))))
(project :name "Substratic Engine"
:url "https://github.com/substratic/engine"
:version "0.0.1"
:description "This is the Substratic Engine library."
:configs (list (config :name "dev"
:default #t
:output-path "./bin/dev"
:c-libs (c-libs #f)
:c-flags (c-flags "-O0 -g -ggdb -DDEV_BUILD -DDEBUG -fsanitize=address " #f))
(config :name "debug"
:output-path "./bin/debug"
:c-libs (c-libs #f)
:c-flags (c-flags "-O0 -g -ggdb -DDEBUG " #f))
(config :name "release"
:output-path "./bin/release"
:c-libs (c-libs #f)
:c-flags (c-flags "-O2 -fPIE " #f))
(config :name "web-debug"
:output-path "./bin/web-debug"
:ar-exe "emar"
:c-compiler "emcc"
:c-libs (c-libs #t)
:c-flags (c-flags "-O0 -g -ggdb -DDEBUG " #t))
(config :name "web-release"
:output-path "./bin/web-release"
:c-libs (c-libs #t)
:c-flags (c-flags "-O2 -fPIE " #t)
:ar-exe "emar"
:c-compiler "emcc"))
:tasks (list (task :name 'substratic-engine:lib
:description "Builds the Substratic Engine library."
:default #t
:runs (steps (compile-source :source-files
'("lib.c" "log.c" "file.c" "renderer.c" "input.c"
"font.c" "shader.c" "texture.c" "window.c" "physics.c"
"particle.c" "spng/spng.c" "glad/src/glad.c")
:c-flags (from-context '(config mesche-compiler:lib) :c-flags)
:c-libs (from-context '(config mesche-compiler:lib) :c-libs))
(create-static-library :library-name "libsubstratic.a"
:input-files (from-context 'substratic-engine:lib/compile-source
:object-files))
(provide-context :library-path (from-context 'substratic-engine:lib/static-library
:library-path)
:c-libs (from-context 'config :c-libs)
:c-flags (from-context 'config :c-flags))))))