forked from GodotVR/godot_openxr_vendors
-
Notifications
You must be signed in to change notification settings - Fork 1
/
SConstruct
64 lines (54 loc) · 1.61 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/usr/bin/env python
from glob import glob
from pathlib import Path
env = SConscript("thirdparty/godot-cpp/SConstruct")
opts = Variables('custom.py')
opts.Update(env)
# Add common includes
env.Append(CPPPATH=[
"#plugin/src/main/cpp/include/",
"#thirdparty/openxr/include/",
])
sources = []
sources += Glob("#plugin/src/main/cpp/*.cpp")
sources += Glob("#plugin/src/main/cpp/export/*.cpp")
sources += Glob("#plugin/src/main/cpp/extensions/*.cpp")
sources += Glob("#plugin/src/main/cpp/classes/*.cpp")
if env["target"] in ["editor", "template_debug"]:
doc_data = env.GodotCPPDocData("#plugin/src/gen/doc_data.gen.cpp", source=Glob("doc_classes/*.xml"))
sources.append(doc_data)
binary_path = '#demo/addons/godotopenxrvendors/.bin'
project_name = 'godotopenxrvendors'
# Statically link with libgcc and libstdc++ for more Linux compatibility.
if env["platform"] == "linux":
env.Append(
LINKFLAGS=[
"-Wl,--no-undefined",
"-static-libgcc",
"-static-libstdc++",
]
)
# Create the library target
if env["platform"] == "macos":
library = env.SharedLibrary(
"{0}/{1}/{2}/lib{3}.{1}.framework/{3}.{1}".format(
binary_path,
env["platform"],
env["target"],
project_name,
),
source=sources,
)
else:
library = env.SharedLibrary(
"{}/{}/{}/{}/lib{}{}".format(
binary_path,
env["platform"],
env["target"],
env["arch"],
project_name,
env["SHLIBSUFFIX"],
),
source=sources,
)
Default(library)