-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathSConstruct
40 lines (35 loc) · 1.03 KB
/
SConstruct
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
#!/usr/bin/env python
from glob import glob
from pathlib import Path
env = SConscript("godot-cpp/SConstruct")
# Add source files.
env.Append(CPPPATH=["src/"])
env.ParseConfig(f"pkg-config libsystemd --cflags --libs")
sources = Glob("src/*.cpp")
project_name = "godot_dbus"
extension_path = f"project/addons/{project_name}/{project_name}.gdextension"
addon_path = Path(extension_path).parent
debug_or_release = "release" if env["target"] == "template_release" else "debug"
if env["platform"] == "macos":
library = env.SharedLibrary(
"{0}/bin/lib{1}.{2}.{3}.framework/{1}.{2}.{3}".format(
addon_path,
project_name,
env["platform"],
debug_or_release,
),
source=sources,
)
else:
library = env.SharedLibrary(
"{}/bin/lib{}.{}.{}.{}{}".format(
addon_path,
project_name,
env["platform"],
debug_or_release,
env["arch"],
env["SHLIBSUFFIX"],
),
source=sources,
)
Default(library)