-
Notifications
You must be signed in to change notification settings - Fork 2
/
BUILD.gn
142 lines (136 loc) · 3.93 KB
/
BUILD.gn
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
cflags = [
"-fPIC",
"-Wall",
"-Wextra",
"-Werror",
"-O3",
]
cflags_c = [
"-std=c99",
"-D_GNU_SOURCE",
"-DCONFIG_VERSION=\"2024-01-13\"",
]
cflags_cc = [
"-std=c++17",
]
if (include_symbols) {
cflags += [ "-g" ]
}
if (debug_cxxstdlib) {
cflags_cc += [ "-D_GLIBCXX_DEBUG" ]
}
ldflags = [
"-Wl,--no-allow-shlib-undefined",
"-Wl,--version-script=" + rebase_path("src/export.map", root_build_dir),
]
if (target_cpu == "arm") {
ldflags += [
"-static-libstdc++",
]
}
if (use_precompiled_font) {
copy("generate_font") {
sources =[
"//tools/font.js",
]
outputs = [
"$target_gen_dir/custom/font.js",
]
}
} else {
action("generate_font") {
script = "tools/generate_font.py"
args = [
"--font=" + rebase_path("tools/fonts/saxmono/saxmono.ttf", root_build_dir),
"--size=22",
"--width=11",
"--height=25",
"--baseline=20",
"-o", rebase_path(target_gen_dir + "/custom/font.js", root_build_dir),
]
outputs = [
"$target_gen_dir/custom/font.js"
]
}
}
action("generate_internal_data") {
script = "tools/bundle_files.py"
deps = [ ":generate_font" ]
inputs = [
"$target_gen_dir/custom/font.js",
"//data/custom/main.js",
"//data/custom/overload.js",
"//data/custom/postsetup.js",
"//data/custom/setup.js",
"//data/PuzzleScript/src/js/colors.js",
"//data/PuzzleScript/src/js/compiler.js",
"//data/PuzzleScript/src/js/debug.js",
"//data/PuzzleScript/src/js/debug_off.js",
"//data/PuzzleScript/src/js/engine.js",
"//data/PuzzleScript/src/js/font.js",
"//data/PuzzleScript/src/js/globalVariables.js",
"//data/PuzzleScript/src/js/graphics.js",
"//data/PuzzleScript/src/js/inputoutput.js",
"//data/PuzzleScript/src/js/parser.js",
"//data/PuzzleScript/src/js/riffwave.js",
"//data/PuzzleScript/src/js/rng.js",
"//data/PuzzleScript/src/js/sfxr.js",
"//data/PuzzleScript/src/js/storagewrapper.js",
"//data/PuzzleScriptPlus/src/js/colors.js",
"//data/PuzzleScriptPlus/src/js/compiler.js",
"//data/PuzzleScriptPlus/src/js/debug.js",
"//data/PuzzleScriptPlus/src/js/debug_off.js",
"//data/PuzzleScriptPlus/src/js/engine.js",
"//data/PuzzleScriptPlus/src/js/font.js",
"//data/PuzzleScriptPlus/src/js/globalVariables.js",
"//data/PuzzleScriptPlus/src/js/graphics.js",
"//data/PuzzleScriptPlus/src/js/inputoutput.js",
"//data/PuzzleScriptPlus/src/js/parser.js",
"//data/PuzzleScriptPlus/src/js/riffwave.js",
"//data/PuzzleScriptPlus/src/js/rng.js",
"//data/PuzzleScriptPlus/src/js/sfxr.js",
"//data/PuzzleScriptPlus/src/js/storagewrapper.js",
]
args = [
"--out", rebase_path(target_gen_dir + "/bundled.h", root_build_dir),
] + rebase_path(inputs, root_build_dir)
outputs = [ "$target_gen_dir/bundled.h" ]
}
source_set("quickjs") {
sources = [
"src/quickjs-ng/quickjs.c",
"src/quickjs-ng/libbf.c",
"src/quickjs-ng/libregexp.c",
"src/quickjs-ng/libunicode.c",
"src/quickjs-ng/cutils.c",
"src/quickjs-ng/quickjs-libc.c",
]
include_dirs = [
"src/quickjs-ng",
]
cflags += [
"-Wno-error",
"-w"
]
}
shared_library("puzzlescript_libretro") {
deps = [ ":quickjs", ":generate_internal_data" ]
sources = [
"src/core.cpp",
"src/audio.cpp",
"src/event.cpp",
"src/generator.cpp",
"src/graphics.cpp",
"src/js.cpp",
"src/rng.cpp",
"src/sfxr.cpp",
"src/sprite.cpp",
"src/pztime.cpp",
]
include_dirs = [
target_gen_dir,
"src/quickjs-ng",
"src/libretro/include",
"src/stb",
]
}