This repository was archived by the owner on Dec 16, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSConstruct
More file actions
147 lines (103 loc) · 4.16 KB
/
SConstruct
File metadata and controls
147 lines (103 loc) · 4.16 KB
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
143
#!/usr/bin/env python
import os
import sys
import platform
from methods import print_error
libname = "KuzuGD"
projectdir = "demo"
localEnv = Environment(tools=["default"], PLATFORM="")
kuzu_paths = {
"windows": {
"lib": "bin/windows/kuzu",
"include": "bin/windows/kuzu/include",
"libs": ["kuzu_shared"]
},
"linux": {
"lib": "bin/linux/kuzu",
"include": "bin/linux/kuzu/include",
"libs": ["libkuzu_x86_64", "libkuzu_aarch64"]
},
"macos": {
"lib": "bin/macos/kuzu",
"include": "bin/macos/kuzu/include",
"libs": ["libkuzu"]
},
"android": {
"lib": "bin/android/kuzu",
"include": "bin/android/kuzu/include",
"libs": ["libkuzu"]
}
}
# Build profiles can be used to decrease compile times.
# You can either specify "disabled_classes", OR
# explicitly specify "enabled_classes" which disables all other classes.
# Modify the example file as needed and uncomment the line below or
# manually specify the build_profile parameter when running SCons.
# localEnv["build_profile"] = "build_profile.json"
customs = ["custom.py"]
customs = [os.path.abspath(path) for path in customs]
opts = Variables(customs, ARGUMENTS)
opts.Update(localEnv)
Help(opts.GenerateHelpText(localEnv))
env = localEnv.Clone()
if not (os.path.isdir("godot-cpp") and os.listdir("godot-cpp")):
print_error("""godot-cpp is not available within this folder, as Git submodules haven't been initialized.
Run the following command to download godot-cpp:
git submodule update --init --recursive""")
sys.exit(1)
env = SConscript("godot-cpp/SConstruct", {"env": env, "customs": customs})
env.Append(CPPPATH=["src/", "src/Kuzu"])
# TODO Add Nested Folders as a new Glob
sources = [Glob("src/*.cpp"), Glob("src/Kuzu/*.cpp"), Glob("src/KuzuGD/*.cpp")]
if env["target"] in ["editor", "template_debug"]:
try:
doc_data = env.GodotCPPDocData("src/gen/doc_data.gen.cpp", source=Glob("doc_classes/*.xml"))
sources.append(doc_data)
except AttributeError:
print("Not including class reference as we're targeting a pre-4.3 baseline.")
kuzu_lib_name = ''
kuzu_generic_name = ''
if(env["platform"] == 'windows'):
env.Append(LINKFLAGS=["/IGNORE:4099"])
env.Append(LIBPATH=["bin/windows/kuzu"])
env.Append(LIBS=["kuzu_shared"])
kuzu_lib_name = "kuzu_shared.dll"
kuzu_generic_name = 'kuzu_shared.dll'
elif (env["platform"] == 'linux'):
env.Append(LIBPATH=["bin/linux/kuzu"])
arch = env["arch"]
kuzu_generic_name = f'libkuzu_{arch}.so'
if arch == "x86_64":
env.Append(LIBS=["libkuzu_x86_64"])
kuzu_lib_name = "libkuzu_x86_64.so"
if arch == "aarch64":
env.Append(LIBS=["libkuzu_aarch64"])
kuzu_lib_name = "libkuzu_aarch64.so"
elif (env["platform"] == 'macos'):
env.Append(LIBPATH=["bin/macos/kuzu"])
env.Append(LIBS=["libkuzu"])
kuzu_lib_name = "libkuzu.dylib"
kuzu_generic_name = 'libkuzu.dylib'
elif (env["platform"] == 'android'):
env.Append(LIBPATH=["bin/android/kuzu"])
env.Append(LIBS=["libkuzu"])
kuzu_lib_name = "libkuzu.so"
kuzu_generic_name = 'libkuzu.so'
# .dev doesn't inhibit compatibility, so we don't need to key it.
# .universal just means "compatible with all relevant arches" so we don't need to key it.
suffix = env['suffix'].replace(".dev", "").replace(".universal", "")
lib_filename = "{}{}{}{}".format(env.subst('$SHLIBPREFIX'), libname, suffix, env.subst('$SHLIBSUFFIX'))
library = env.SharedLibrary(
"bin/{}/{}".format(env['platform'], lib_filename),
source=sources,
)
copy = env.Install("{}/bin/{}/".format(projectdir, env["platform"]), library)
kuzu_library_path = "bin/{}/kuzu/{}/".format(env['platform'], kuzu_lib_name)
kuzu_copy = env.InstallAs("{}/bin/{}/{}".format(projectdir, env["platform"], kuzu_generic_name), kuzu_library_path)
if(env["platform"] == 'windows'):
kuzu_lib_copy = env.InstallAs("{}/bin/{}/kuzu_shared.lib".format(projectdir, env["platform"]), "bin/windows/kuzu/kuzu_shared.lib")
default_args = [library, copy, kuzu_copy, kuzu_lib_copy]
Default(*default_args)
else :
default_args = [library, copy, kuzu_copy]
Default(*default_args)