-
Notifications
You must be signed in to change notification settings - Fork 0
/
project.msc
71 lines (62 loc) · 4.18 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
(define-module (flux-harmonic syphon-break)
(import (mesche fs)
(mesche list)
(mesche string)
(mesche process)
(mesche build)
(mesche project)))
(project :name "Syphon Break"
:url "https://github.com/FluxHarmonic/syphon-break"
:version "0.0.1"
:description "How long can you survive before energy runs out?"
:deps (list (mesche-lib "mesche-lang/mesche")
(mesche-lib "substratic/engine"))
:configs (list (config :name "dev"
:default #t
:output-path "./bin/dev"
:c-flags "-O0 -g -ggdb -DDEV_BUILD -fsanitize=address")
(config :name "debug"
:output-path "./bin/debug"
:c-flags "-O0 -g -ggdb -DDEBUG")
(config :name "release"
:output-path "./bin/release"
:c-flags "-O2 -fPIE"))
:tasks (list (task :name 'syphon-break:bin
:default #t
:runs (steps
;; Build library dependencies
(build-project "deps/mesche-lang/mesche/project.msc"
:task 'mesche-compiler:lib
:config (from-context 'config :name))
(build-project "deps/substratic/engine/project.msc"
:task 'substratic-engine:lib
:config (from-context 'config :name))
;; Build the game source
(compile-source :source-files (list "main.c")
:mesche-main "modules/main.msc"
:c-flags (from-context '(config
mesche-compiler:lib
substratic-engine:lib)
:c-flags))
;; Build and link CLI source files
(link-program :name "syphon-break"
:input-files (collect '((syphon-break:bin/compile-source :object-files)
(mesche-compiler:lib :library-path)
(substratic-engine:lib :library-path)))
:c-libs (from-context '(config
substratic-engine:lib
mesche-compiler:lib)
:c-libs))))
(task :name 'syphon-break:dist
:runs (steps (build-task 'syphon-break:bin)
(lambda (project config outputs)
;; TODO: Clean existing dist folder?
(path-ensure "./dist")
(process-start-sync (string-append "cp "
(project-config-output-path config)
"/syphon-break "
"dist/"))
(process-start-sync "cp -R ./modules ./dist")
(process-start-sync "cp -R ./assets ./dist")
(process-start-sync "cp -R ./deps/substratic/engine/modules/substratic ./dist/modules")
#f)))))