-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathSCSub_bindgen.py
41 lines (31 loc) · 1.08 KB
/
SCSub_bindgen.py
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
#!/usr/bin/env python
import os
import bindgen.luau_api_generator as luau_api_generator
import bindgen.luau_binding_generator as luau_binding_generator
Import("env")
env_gen = env.Clone()
env_gen.Append(
BUILDERS={
"GenerateLuauApi": Builder(
action=luau_api_generator.generate_bindings,
emitter=luau_api_generator.emit_files,
),
"GenerateLuauBindings": Builder(
action=luau_binding_generator.generate_bindings,
emitter=luau_binding_generator.emit_files,
),
}
)
luau_api = env_gen.GenerateLuauApi()
luau_bindings = env_gen.GenerateLuauBindings()
if env["generate_luau_bindings"]:
NoCache(luau_api)
NoCache(luau_bindings)
AlwaysBuild(luau_api)
AlwaysBuild(luau_bindings)
sources = [f for f in luau_bindings if str(f).endswith(".cpp")]
env.Append(CPPPATH=["gen/include/"])
env_gen.Append(CPPPATH=["src/", "gen/include/"])
lib = env_gen.Library("gdluau_gen", source=sources)
# Prepend important! This library depends on godot-cpp, so it should be linked *after* this.
env.Prepend(LIBS=[lib])