-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproject.msc
71 lines (62 loc) · 4.23 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 call-of-the-stones)
(import (mesche fs)
(mesche list)
(mesche string)
(mesche process)
(mesche build)
(mesche project)))
(project :name "Call of the Stones"
:url "https://github.com/FluxHarmonic/ggo2022-call-of-the-stones"
:version "0.0.1"
:description "Restore the Purity Stones to clear the air!"
: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 'call-of-the-stones: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 "stones"
:input-files (collect '((call-of-the-stones: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 'call-of-the-stones:dist
:runs (steps (build-task 'call-of-the-stones:bin)
(lambda (project config outputs)
;; TODO: Clean existing dist folder?
(path-ensure "./dist")
(process-start-sync (string-append "cp "
(project-config-output-path config)
"/call-of-the-stones "
"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)))))