SCons: Format buildsystem files with psf/black

Configured for a max line length of 120 characters.

psf/black is very opinionated and purposely doesn't leave much room for
configuration. The output is mostly OK so that should be fine for us,
but some things worth noting:

- Manually wrapped strings will be reflowed, so by using a line length
  of 120 for the sake of preserving readability for our long command
  calls, it also means that some manually wrapped strings are back on
  the same line and should be manually merged again.

- Code generators using string concatenation extensively look awful,
  since black puts each operand on a single line. We need to refactor
  these generators to use more pythonic string formatting, for which
  many options are available (`%`, `format` or f-strings).

- CI checks and a pre-commit hook will be added to ensure that future
  buildsystem changes are well-formatted.
This commit is contained in:
Rémi Verschelde
2020-03-30 08:28:32 +02:00
parent 0168709978
commit cd4e46ee65
198 changed files with 4216 additions and 3446 deletions
+260 -217
View File
File diff suppressed because it is too large Load Diff
+60 -47
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env python
Import('env')
Import("env")
import core_builders
import make_binders
@@ -11,31 +11,32 @@ env.core_sources = []
# Generate AES256 script encryption key
import os
txt = "0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0"
if ("SCRIPT_AES256_ENCRYPTION_KEY" in os.environ):
if "SCRIPT_AES256_ENCRYPTION_KEY" in os.environ:
e = os.environ["SCRIPT_AES256_ENCRYPTION_KEY"]
txt = ""
ec_valid = True
if (len(e) != 64):
if len(e) != 64:
ec_valid = False
else:
for i in range(len(e) >> 1):
if (i > 0):
if i > 0:
txt += ","
txts = "0x" + e[i * 2:i * 2 + 2]
txts = "0x" + e[i * 2 : i * 2 + 2]
try:
int(txts, 16)
except:
ec_valid = False
txt += txts
if (not ec_valid):
if not ec_valid:
txt = "0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0"
print("Invalid AES256 encryption key, not 64 bits hex: " + e)
# NOTE: It is safe to generate this file here, since this is still executed serially
with open("script_encryption_key.gen.cpp", "w") as f:
f.write("#include \"core/project_settings.h\"\nuint8_t script_encryption_key[32]={" + txt + "};\n")
f.write('#include "core/project_settings.h"\nuint8_t script_encryption_key[32]={' + txt + "};\n")
# Add required thirdparty code.
@@ -49,7 +50,6 @@ thirdparty_misc_sources = [
# C sources
"fastlz.c",
"smaz.c",
# C++ sources
"hq2x.cpp",
"pcg.cpp",
@@ -60,30 +60,30 @@ thirdparty_misc_sources = [thirdparty_misc_dir + file for file in thirdparty_mis
env_thirdparty.add_source_files(env.core_sources, thirdparty_misc_sources)
# Zlib library, can be unbundled
if env['builtin_zlib']:
thirdparty_zlib_dir = "#thirdparty/zlib/"
thirdparty_zlib_sources = [
"adler32.c",
"compress.c",
"crc32.c",
"deflate.c",
"infback.c",
"inffast.c",
"inflate.c",
"inftrees.c",
"trees.c",
"uncompr.c",
"zutil.c",
]
thirdparty_zlib_sources = [thirdparty_zlib_dir + file for file in thirdparty_zlib_sources]
if env["builtin_zlib"]:
thirdparty_zlib_dir = "#thirdparty/zlib/"
thirdparty_zlib_sources = [
"adler32.c",
"compress.c",
"crc32.c",
"deflate.c",
"infback.c",
"inffast.c",
"inflate.c",
"inftrees.c",
"trees.c",
"uncompr.c",
"zutil.c",
]
thirdparty_zlib_sources = [thirdparty_zlib_dir + file for file in thirdparty_zlib_sources]
env_thirdparty.Prepend(CPPPATH=[thirdparty_zlib_dir])
# Needs to be available in main env too
env.Prepend(CPPPATH=[thirdparty_zlib_dir])
if (env['target'] == 'debug'):
env_thirdparty.Append(CPPDEFINES=['ZLIB_DEBUG'])
env_thirdparty.Prepend(CPPPATH=[thirdparty_zlib_dir])
# Needs to be available in main env too
env.Prepend(CPPPATH=[thirdparty_zlib_dir])
if env["target"] == "debug":
env_thirdparty.Append(CPPDEFINES=["ZLIB_DEBUG"])
env_thirdparty.add_source_files(env.core_sources, thirdparty_zlib_sources)
env_thirdparty.add_source_files(env.core_sources, thirdparty_zlib_sources)
# Minizip library, could be unbundled in theory
# However, our version has some custom modifications, so it won't compile with the system one
@@ -99,7 +99,7 @@ env_thirdparty.add_source_files(env.core_sources, thirdparty_minizip_sources)
# Zstd library, can be unbundled in theory
# though we currently use some private symbols
# https://github.com/godotengine/godot/issues/17374
if env['builtin_zstd']:
if env["builtin_zstd"]:
thirdparty_zstd_dir = "#thirdparty/zstd/"
thirdparty_zstd_sources = [
"common/debug.c",
@@ -142,32 +142,45 @@ if env['builtin_zstd']:
env.add_source_files(env.core_sources, "*.cpp")
# Certificates
env.Depends("#core/io/certs_compressed.gen.h", ["#thirdparty/certs/ca-certificates.crt", env.Value(env['builtin_certs']), env.Value(env['system_certs_path'])])
env.CommandNoCache("#core/io/certs_compressed.gen.h", "#thirdparty/certs/ca-certificates.crt", run_in_subprocess(core_builders.make_certs_header))
env.Depends(
"#core/io/certs_compressed.gen.h",
["#thirdparty/certs/ca-certificates.crt", env.Value(env["builtin_certs"]), env.Value(env["system_certs_path"])],
)
env.CommandNoCache(
"#core/io/certs_compressed.gen.h",
"#thirdparty/certs/ca-certificates.crt",
run_in_subprocess(core_builders.make_certs_header),
)
# Make binders
env.CommandNoCache(['method_bind.gen.inc', 'method_bind_ext.gen.inc', 'method_bind_free_func.gen.inc'], 'make_binders.py', run_in_subprocess(make_binders.run))
env.CommandNoCache(
["method_bind.gen.inc", "method_bind_ext.gen.inc", "method_bind_free_func.gen.inc"],
"make_binders.py",
run_in_subprocess(make_binders.run),
)
# Authors
env.Depends('#core/authors.gen.h', "../AUTHORS.md")
env.CommandNoCache('#core/authors.gen.h', "../AUTHORS.md", run_in_subprocess(core_builders.make_authors_header))
env.Depends("#core/authors.gen.h", "../AUTHORS.md")
env.CommandNoCache("#core/authors.gen.h", "../AUTHORS.md", run_in_subprocess(core_builders.make_authors_header))
# Donors
env.Depends('#core/donors.gen.h', "../DONORS.md")
env.CommandNoCache('#core/donors.gen.h', "../DONORS.md", run_in_subprocess(core_builders.make_donors_header))
env.Depends("#core/donors.gen.h", "../DONORS.md")
env.CommandNoCache("#core/donors.gen.h", "../DONORS.md", run_in_subprocess(core_builders.make_donors_header))
# License
env.Depends('#core/license.gen.h', ["../COPYRIGHT.txt", "../LICENSE.txt"])
env.CommandNoCache('#core/license.gen.h', ["../COPYRIGHT.txt", "../LICENSE.txt"], run_in_subprocess(core_builders.make_license_header))
env.Depends("#core/license.gen.h", ["../COPYRIGHT.txt", "../LICENSE.txt"])
env.CommandNoCache(
"#core/license.gen.h", ["../COPYRIGHT.txt", "../LICENSE.txt"], run_in_subprocess(core_builders.make_license_header)
)
# Chain load SCsubs
SConscript('os/SCsub')
SConscript('math/SCsub')
SConscript('crypto/SCsub')
SConscript('io/SCsub')
SConscript('debugger/SCsub')
SConscript('input/SCsub')
SConscript('bind/SCsub')
SConscript("os/SCsub")
SConscript("math/SCsub")
SConscript("crypto/SCsub")
SConscript("io/SCsub")
SConscript("debugger/SCsub")
SConscript("input/SCsub")
SConscript("bind/SCsub")
# Build it all as a library
+1 -1
View File
@@ -1,5 +1,5 @@
#!/usr/bin/env python
Import('env')
Import("env")
env.add_source_files(env.core_sources, "*.cpp")
+91 -46
View File
@@ -11,15 +11,15 @@ def escape_string(s):
rev_result = []
while c >= 256:
c, low = (c // 256, c % 256)
rev_result.append('\\%03o' % low)
rev_result.append('\\%03o' % c)
return ''.join(reversed(rev_result))
rev_result.append("\\%03o" % low)
rev_result.append("\\%03o" % c)
return "".join(reversed(rev_result))
result = ''
result = ""
if isinstance(s, str):
s = s.encode('utf-8')
s = s.encode("utf-8")
for c in s:
if not(32 <= c < 127) or c in (ord('\\'), ord('"')):
if not (32 <= c < 127) or c in (ord("\\"), ord('"')):
result += charcode_to_c_escapes(c)
else:
result += chr(c)
@@ -34,6 +34,7 @@ def make_certs_header(target, source, env):
buf = f.read()
decomp_size = len(buf)
import zlib
buf = zlib.compress(buf)
g.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n")
@@ -41,9 +42,9 @@ def make_certs_header(target, source, env):
g.write("#define CERTS_COMPRESSED_GEN_H\n")
# System certs path. Editor will use them if defined. (for package maintainers)
path = env['system_certs_path']
g.write("#define _SYSTEM_CERTS_PATH \"%s\"\n" % str(path))
if env['builtin_certs']:
path = env["system_certs_path"]
g.write('#define _SYSTEM_CERTS_PATH "%s"\n' % str(path))
if env["builtin_certs"]:
# Defined here and not in env so changing it does not trigger a full rebuild.
g.write("#define BUILTIN_CERTS_ENABLED\n")
g.write("static const int _certs_compressed_size = " + str(len(buf)) + ";\n")
@@ -59,8 +60,18 @@ def make_certs_header(target, source, env):
def make_authors_header(target, source, env):
sections = ["Project Founders", "Lead Developer", "Project Manager", "Developers"]
sections_id = ["AUTHORS_FOUNDERS", "AUTHORS_LEAD_DEVELOPERS", "AUTHORS_PROJECT_MANAGERS", "AUTHORS_DEVELOPERS"]
sections = [
"Project Founders",
"Lead Developer",
"Project Manager",
"Developers",
]
sections_id = [
"AUTHORS_FOUNDERS",
"AUTHORS_LEAD_DEVELOPERS",
"AUTHORS_PROJECT_MANAGERS",
"AUTHORS_DEVELOPERS",
]
src = source[0]
dst = target[0]
@@ -80,7 +91,7 @@ def make_authors_header(target, source, env):
for line in f:
if reading:
if line.startswith(" "):
g.write("\t\"" + escape_string(line.strip()) + "\",\n")
g.write('\t"' + escape_string(line.strip()) + '",\n')
continue
if line.startswith("## "):
if reading:
@@ -103,10 +114,22 @@ def make_authors_header(target, source, env):
def make_donors_header(target, source, env):
sections = ["Platinum sponsors", "Gold sponsors", "Mini sponsors",
"Gold donors", "Silver donors", "Bronze donors"]
sections_id = ["DONORS_SPONSOR_PLAT", "DONORS_SPONSOR_GOLD", "DONORS_SPONSOR_MINI",
"DONORS_GOLD", "DONORS_SILVER", "DONORS_BRONZE"]
sections = [
"Platinum sponsors",
"Gold sponsors",
"Mini sponsors",
"Gold donors",
"Silver donors",
"Bronze donors",
]
sections_id = [
"DONORS_SPONSOR_PLAT",
"DONORS_SPONSOR_GOLD",
"DONORS_SPONSOR_MINI",
"DONORS_GOLD",
"DONORS_SILVER",
"DONORS_BRONZE",
]
src = source[0]
dst = target[0]
@@ -126,7 +149,7 @@ def make_donors_header(target, source, env):
for line in f:
if reading >= 0:
if line.startswith(" "):
g.write("\t\"" + escape_string(line.strip()) + "\",\n")
g.write('\t"' + escape_string(line.strip()) + '",\n')
continue
if line.startswith("## "):
if reading:
@@ -169,8 +192,8 @@ def make_license_header(target, source, env):
return line
def next_tag(self):
if not ':' in self.current:
return ('', [])
if not ":" in self.current:
return ("", [])
tag, line = self.current.split(":", 1)
lines = [line.strip()]
while self.next_line() and self.current.startswith(" "):
@@ -178,6 +201,7 @@ def make_license_header(target, source, env):
return (tag, lines)
from collections import OrderedDict
projects = OrderedDict()
license_list = []
@@ -218,26 +242,30 @@ def make_license_header(target, source, env):
with open(src_license, "r", encoding="utf-8") as license_file:
for line in license_file:
escaped_string = escape_string(line.strip())
f.write("\n\t\t\"" + escaped_string + "\\n\"")
f.write('\n\t\t"' + escaped_string + '\\n"')
f.write(";\n\n")
f.write("struct ComponentCopyrightPart {\n"
"\tconst char *license;\n"
"\tconst char *const *files;\n"
"\tconst char *const *copyright_statements;\n"
"\tint file_count;\n"
"\tint copyright_count;\n"
"};\n\n")
f.write(
"struct ComponentCopyrightPart {\n"
"\tconst char *license;\n"
"\tconst char *const *files;\n"
"\tconst char *const *copyright_statements;\n"
"\tint file_count;\n"
"\tint copyright_count;\n"
"};\n\n"
)
f.write("struct ComponentCopyright {\n"
"\tconst char *name;\n"
"\tconst ComponentCopyrightPart *parts;\n"
"\tint part_count;\n"
"};\n\n")
f.write(
"struct ComponentCopyright {\n"
"\tconst char *name;\n"
"\tconst ComponentCopyrightPart *parts;\n"
"\tint part_count;\n"
"};\n\n"
)
f.write("const char *const COPYRIGHT_INFO_DATA[] = {\n")
for line in data_list:
f.write("\t\"" + escape_string(line) + "\",\n")
f.write('\t"' + escape_string(line) + '",\n')
f.write("};\n\n")
f.write("const ComponentCopyrightPart COPYRIGHT_PROJECT_PARTS[] = {\n")
@@ -246,11 +274,21 @@ def make_license_header(target, source, env):
for project_name, project in iter(projects.items()):
part_indexes[project_name] = part_index
for part in project:
f.write("\t{ \"" + escape_string(part["License"][0]) + "\", "
+ "&COPYRIGHT_INFO_DATA[" + str(part["file_index"]) + "], "
+ "&COPYRIGHT_INFO_DATA[" + str(part["copyright_index"]) + "], "
+ str(len(part["Files"])) + ", "
+ str(len(part["Copyright"])) + " },\n")
f.write(
'\t{ "'
+ escape_string(part["License"][0])
+ '", '
+ "&COPYRIGHT_INFO_DATA["
+ str(part["file_index"])
+ "], "
+ "&COPYRIGHT_INFO_DATA["
+ str(part["copyright_index"])
+ "], "
+ str(len(part["Files"]))
+ ", "
+ str(len(part["Copyright"]))
+ " },\n"
)
part_index += 1
f.write("};\n\n")
@@ -258,30 +296,37 @@ def make_license_header(target, source, env):
f.write("const ComponentCopyright COPYRIGHT_INFO[] = {\n")
for project_name, project in iter(projects.items()):
f.write("\t{ \"" + escape_string(project_name) + "\", "
+ "&COPYRIGHT_PROJECT_PARTS[" + str(part_indexes[project_name]) + "], "
+ str(len(project)) + " },\n")
f.write(
'\t{ "'
+ escape_string(project_name)
+ '", '
+ "&COPYRIGHT_PROJECT_PARTS["
+ str(part_indexes[project_name])
+ "], "
+ str(len(project))
+ " },\n"
)
f.write("};\n\n")
f.write("const int LICENSE_COUNT = " + str(len(license_list)) + ";\n")
f.write("const char *const LICENSE_NAMES[] = {\n")
for l in license_list:
f.write("\t\"" + escape_string(l[0]) + "\",\n")
f.write('\t"' + escape_string(l[0]) + '",\n')
f.write("};\n\n")
f.write("const char *const LICENSE_BODIES[] = {\n\n")
for l in license_list:
for line in l[1:]:
if line == ".":
f.write("\t\"\\n\"\n")
f.write('\t"\\n"\n')
else:
f.write("\t\"" + escape_string(line) + "\\n\"\n")
f.write("\t\"\",\n\n")
f.write('\t"' + escape_string(line) + '\\n"\n')
f.write('\t"",\n\n')
f.write("};\n\n")
f.write("#endif // LICENSE_GEN_H\n")
if __name__ == '__main__':
if __name__ == "__main__":
subprocess_main(globals())
+5 -3
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env python
Import('env')
Import("env")
env_crypto = env.Clone()
@@ -22,7 +22,9 @@ if not has_module:
env_thirdparty = env_crypto.Clone()
env_thirdparty.disable_warnings()
# Custom config file
env_thirdparty.Append(CPPDEFINES=[('MBEDTLS_CONFIG_FILE', '\\"thirdparty/mbedtls/include/godot_core_mbedtls_config.h\\"')])
env_thirdparty.Append(
CPPDEFINES=[("MBEDTLS_CONFIG_FILE", '\\"thirdparty/mbedtls/include/godot_core_mbedtls_config.h\\"')]
)
thirdparty_mbedtls_dir = "#thirdparty/mbedtls/library/"
thirdparty_mbedtls_sources = [
"aes.c",
@@ -30,7 +32,7 @@ if not has_module:
"md5.c",
"sha1.c",
"sha256.c",
"godot_core_mbedtls_platform.c"
"godot_core_mbedtls_platform.c",
]
thirdparty_mbedtls_sources = [thirdparty_mbedtls_dir + file for file in thirdparty_mbedtls_sources]
env_thirdparty.add_source_files(env.core_sources, thirdparty_mbedtls_sources)
+1 -1
View File
@@ -1,5 +1,5 @@
#!/usr/bin/env python
Import('env')
Import("env")
env.add_source_files(env.core_sources, "*.cpp")
+12 -4
View File
@@ -1,20 +1,28 @@
#!/usr/bin/env python
Import('env')
Import("env")
from platform_methods import run_in_subprocess
import input_builders
# Order matters here. Higher index controller database files write on top of lower index database files.
controller_databases = ["#core/input/gamecontrollerdb_204.txt", "#core/input/gamecontrollerdb_205.txt", "#core/input/gamecontrollerdb.txt", "#core/input/godotcontrollerdb.txt"]
controller_databases = [
"#core/input/gamecontrollerdb_204.txt",
"#core/input/gamecontrollerdb_205.txt",
"#core/input/gamecontrollerdb.txt",
"#core/input/godotcontrollerdb.txt",
]
env.Depends("#core/input/default_controller_mappings.gen.cpp", controller_databases)
env.CommandNoCache("#core/input/default_controller_mappings.gen.cpp", controller_databases, run_in_subprocess(input_builders.make_default_controller_mappings))
env.CommandNoCache(
"#core/input/default_controller_mappings.gen.cpp",
controller_databases,
run_in_subprocess(input_builders.make_default_controller_mappings),
)
env.add_source_files(env.core_sources, "*.cpp")
# Don't warn about duplicate entry here, we need it registered manually for first build,
# even if later builds will pick it up twice due to above *.cpp globbing.
env.add_source_files(env.core_sources, "#core/input/default_controller_mappings.gen.cpp", warn_duplicates=False)
+14 -6
View File
@@ -12,8 +12,8 @@ def make_default_controller_mappings(target, source, env):
g = open(dst, "w")
g.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n")
g.write("#include \"core/typedefs.h\"\n")
g.write("#include \"core/input/default_controller_mappings.h\"\n")
g.write('#include "core/typedefs.h"\n')
g.write('#include "core/input/default_controller_mappings.h"\n')
# ensure mappings have a consistent order
platform_mappings = OrderedDict()
@@ -37,11 +37,19 @@ def make_default_controller_mappings(target, source, env):
line_parts = line.split(",")
guid = line_parts[0]
if guid in platform_mappings[current_platform]:
g.write("// WARNING - DATABASE {} OVERWROTE PRIOR MAPPING: {} {}\n".format(src_path, current_platform, platform_mappings[current_platform][guid]))
g.write(
"// WARNING - DATABASE {} OVERWROTE PRIOR MAPPING: {} {}\n".format(
src_path, current_platform, platform_mappings[current_platform][guid]
)
)
valid_mapping = True
for input_map in line_parts[2:]:
if "+" in input_map or "-" in input_map or "~" in input_map:
g.write("// WARNING - DISCARDED UNSUPPORTED MAPPING TYPE FROM DATABASE {}: {} {}\n".format(src_path, current_platform, line))
g.write(
"// WARNING - DISCARDED UNSUPPORTED MAPPING TYPE FROM DATABASE {}: {} {}\n".format(
src_path, current_platform, line
)
)
valid_mapping = False
break
if valid_mapping:
@@ -62,12 +70,12 @@ def make_default_controller_mappings(target, source, env):
variable = platform_variables[platform]
g.write("{}\n".format(variable))
for mapping in mappings.values():
g.write("\t\"{}\",\n".format(mapping))
g.write('\t"{}",\n'.format(mapping))
g.write("#endif\n")
g.write("\tNULL\n};\n")
g.close()
if __name__ == '__main__':
if __name__ == "__main__":
subprocess_main(globals())
+1 -1
View File
@@ -1,5 +1,5 @@
#!/usr/bin/env python
Import('env')
Import("env")
env.add_source_files(env.core_sources, "*.cpp")
+25 -23
View File
@@ -280,58 +280,57 @@ MethodBind* create_method_bind($ifret R$ $ifnoret void$ (*p_method)($ifconst con
"""
def make_version(template, nargs, argmax, const, ret):
intext = template
from_pos = 0
outtext = ""
while(True):
while True:
to_pos = intext.find("$", from_pos)
if (to_pos == -1):
if to_pos == -1:
outtext += intext[from_pos:]
break
else:
outtext += intext[from_pos:to_pos]
end = intext.find("$", to_pos + 1)
if (end == -1):
if end == -1:
break # ignore
macro = intext[to_pos + 1:end]
macro = intext[to_pos + 1 : end]
cmd = ""
data = ""
if (macro.find(" ") != -1):
cmd = macro[0:macro.find(" ")]
data = macro[macro.find(" ") + 1:]
if macro.find(" ") != -1:
cmd = macro[0 : macro.find(" ")]
data = macro[macro.find(" ") + 1 :]
else:
cmd = macro
if (cmd == "argc"):
if cmd == "argc":
outtext += str(nargs)
if (cmd == "ifret" and ret):
if cmd == "ifret" and ret:
outtext += data
if (cmd == "ifargs" and nargs):
if cmd == "ifargs" and nargs:
outtext += data
if (cmd == "ifretargs" and nargs and ret):
if cmd == "ifretargs" and nargs and ret:
outtext += data
if (cmd == "ifconst" and const):
if cmd == "ifconst" and const:
outtext += data
elif (cmd == "ifnoconst" and not const):
elif cmd == "ifnoconst" and not const:
outtext += data
elif (cmd == "ifnoret" and not ret):
elif cmd == "ifnoret" and not ret:
outtext += data
elif (cmd == "iftempl" and (nargs > 0 or ret)):
elif cmd == "iftempl" and (nargs > 0 or ret):
outtext += data
elif (cmd == "arg,"):
elif cmd == "arg,":
for i in range(1, nargs + 1):
if (i > 1):
if i > 1:
outtext += ", "
outtext += data.replace("@", str(i))
elif (cmd == "arg"):
elif cmd == "arg":
for i in range(1, nargs + 1):
outtext += data.replace("@", str(i))
elif (cmd == "noarg"):
elif cmd == "noarg":
for i in range(nargs + 1, argmax + 1):
outtext += data.replace("@", str(i))
@@ -348,7 +347,9 @@ def run(target, source, env):
text_ext = ""
text_free_func = "#ifndef METHOD_BIND_FREE_FUNC_H\n#define METHOD_BIND_FREE_FUNC_H\n"
text_free_func += "\n//including this header file allows method binding to use free functions\n"
text_free_func += "//note that the free function must have a pointer to an instance of the class as its first parameter\n"
text_free_func += (
"//note that the free function must have a pointer to an instance of the class as its first parameter\n"
)
for i in range(0, versions + 1):
@@ -361,7 +362,7 @@ def run(target, source, env):
t += make_version(template_typed, i, versions, True, False)
t += make_version(template, i, versions, True, True)
t += make_version(template_typed, i, versions, True, True)
if (i >= versions_ext):
if i >= versions_ext:
text_ext += t
else:
text += t
@@ -383,6 +384,7 @@ def run(target, source, env):
f.write(text_free_func)
if __name__ == '__main__':
if __name__ == "__main__":
from platform_methods import subprocess_main
subprocess_main(globals())
+1 -1
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env python
Import('env')
Import("env")
env_math = env.Clone()
+1 -1
View File
@@ -1,5 +1,5 @@
#!/usr/bin/env python
Import('env')
Import("env")
env.add_source_files(env.core_sources, "*.cpp")
+65 -43
View File
@@ -21,7 +21,7 @@ def write_string(_f, text, newline=True):
for t in range(tab):
_f.write("\t")
_f.write(text)
if (newline):
if newline:
_f.write("\n")
@@ -30,7 +30,7 @@ def escape(ret):
ret = ret.replace("<", "&gt;")
ret = ret.replace(">", "&lt;")
ret = ret.replace("'", "&apos;")
ret = ret.replace("\"", "&quot;")
ret = ret.replace('"', "&quot;")
return ret
@@ -43,25 +43,26 @@ def dec_tab():
global tab
tab -= 1
write_string(f, '<?xml version="1.0" encoding="UTF-8" ?>')
write_string(f, '<doc version="' + new_doc.attrib["version"] + '">')
def get_tag(node, name):
tag = ""
if (name in node.attrib):
tag = ' ' + name + '="' + escape(node.attrib[name]) + '" '
if name in node.attrib:
tag = " " + name + '="' + escape(node.attrib[name]) + '" '
return tag
def find_method_descr(old_class, name):
methods = old_class.find("methods")
if(methods != None and len(list(methods)) > 0):
if methods != None and len(list(methods)) > 0:
for m in list(methods):
if (m.attrib["name"] == name):
if m.attrib["name"] == name:
description = m.find("description")
if (description != None and description.text.strip() != ""):
if description != None and description.text.strip() != "":
return description.text
return None
@@ -70,11 +71,11 @@ def find_method_descr(old_class, name):
def find_signal_descr(old_class, name):
signals = old_class.find("signals")
if(signals != None and len(list(signals)) > 0):
if signals != None and len(list(signals)) > 0:
for m in list(signals):
if (m.attrib["name"] == name):
if m.attrib["name"] == name:
description = m.find("description")
if (description != None and description.text.strip() != ""):
if description != None and description.text.strip() != "":
return description.text
return None
@@ -82,13 +83,13 @@ def find_signal_descr(old_class, name):
def find_constant_descr(old_class, name):
if (old_class is None):
if old_class is None:
return None
constants = old_class.find("constants")
if(constants != None and len(list(constants)) > 0):
if constants != None and len(list(constants)) > 0:
for m in list(constants):
if (m.attrib["name"] == name):
if (m.text.strip() != ""):
if m.attrib["name"] == name:
if m.text.strip() != "":
return m.text
return None
@@ -96,35 +97,35 @@ def find_constant_descr(old_class, name):
def write_class(c):
class_name = c.attrib["name"]
print("Parsing Class: " + class_name)
if (class_name in old_classes):
if class_name in old_classes:
old_class = old_classes[class_name]
else:
old_class = None
category = get_tag(c, "category")
inherits = get_tag(c, "inherits")
write_string(f, '<class name="' + class_name + '" ' + category + inherits + '>')
write_string(f, '<class name="' + class_name + '" ' + category + inherits + ">")
inc_tab()
write_string(f, "<brief_description>")
if (old_class != None):
if old_class != None:
old_brief_descr = old_class.find("brief_description")
if (old_brief_descr != None):
if old_brief_descr != None:
write_string(f, escape(old_brief_descr.text.strip()))
write_string(f, "</brief_description>")
write_string(f, "<description>")
if (old_class != None):
if old_class != None:
old_descr = old_class.find("description")
if (old_descr != None):
if old_descr != None:
write_string(f, escape(old_descr.text.strip()))
write_string(f, "</description>")
methods = c.find("methods")
if(methods != None and len(list(methods)) > 0):
if methods != None and len(list(methods)) > 0:
write_string(f, "<methods>")
inc_tab()
@@ -132,35 +133,46 @@ def write_class(c):
for m in list(methods):
qualifiers = get_tag(m, "qualifiers")
write_string(f, '<method name="' + escape(m.attrib["name"]) + '" ' + qualifiers + '>')
write_string(f, '<method name="' + escape(m.attrib["name"]) + '" ' + qualifiers + ">")
inc_tab()
for a in list(m):
if (a.tag == "return"):
if a.tag == "return":
typ = get_tag(a, "type")
write_string(f, '<return' + typ + '>')
write_string(f, '</return>')
elif (a.tag == "argument"):
write_string(f, "<return" + typ + ">")
write_string(f, "</return>")
elif a.tag == "argument":
default = get_tag(a, "default")
write_string(f, '<argument index="' + a.attrib["index"] + '" name="' + escape(a.attrib["name"]) + '" type="' + a.attrib["type"] + '"' + default + '>')
write_string(f, '</argument>')
write_string(
f,
'<argument index="'
+ a.attrib["index"]
+ '" name="'
+ escape(a.attrib["name"])
+ '" type="'
+ a.attrib["type"]
+ '"'
+ default
+ ">",
)
write_string(f, "</argument>")
write_string(f, '<description>')
if (old_class != None):
write_string(f, "<description>")
if old_class != None:
old_method_descr = find_method_descr(old_class, m.attrib["name"])
if (old_method_descr):
if old_method_descr:
write_string(f, escape(escape(old_method_descr.strip())))
write_string(f, '</description>')
write_string(f, "</description>")
dec_tab()
write_string(f, "</method>")
dec_tab()
write_string(f, "</methods>")
signals = c.find("signals")
if(signals != None and len(list(signals)) > 0):
if signals != None and len(list(signals)) > 0:
write_string(f, "<signals>")
inc_tab()
@@ -171,24 +183,33 @@ def write_class(c):
inc_tab()
for a in list(m):
if (a.tag == "argument"):
if a.tag == "argument":
write_string(f, '<argument index="' + a.attrib["index"] + '" name="' + escape(a.attrib["name"]) + '" type="' + a.attrib["type"] + '">')
write_string(f, '</argument>')
write_string(
f,
'<argument index="'
+ a.attrib["index"]
+ '" name="'
+ escape(a.attrib["name"])
+ '" type="'
+ a.attrib["type"]
+ '">',
)
write_string(f, "</argument>")
write_string(f, '<description>')
if (old_class != None):
write_string(f, "<description>")
if old_class != None:
old_signal_descr = find_signal_descr(old_class, m.attrib["name"])
if (old_signal_descr):
if old_signal_descr:
write_string(f, escape(old_signal_descr.strip()))
write_string(f, '</description>')
write_string(f, "</description>")
dec_tab()
write_string(f, "</signal>")
dec_tab()
write_string(f, "</signals>")
constants = c.find("constants")
if(constants != None and len(list(constants)) > 0):
if constants != None and len(list(constants)) > 0:
write_string(f, "<constants>")
inc_tab()
@@ -197,7 +218,7 @@ def write_class(c):
write_string(f, '<constant name="' + escape(m.attrib["name"]) + '" value="' + m.attrib["value"] + '">')
old_constant_descr = find_constant_descr(old_class, m.attrib["name"])
if (old_constant_descr):
if old_constant_descr:
write_string(f, escape(old_constant_descr.strip()))
write_string(f, "</constant>")
@@ -207,9 +228,10 @@ def write_class(c):
dec_tab()
write_string(f, "</class>")
for c in list(old_doc):
old_classes[c.attrib["name"]] = c
for c in list(new_doc):
write_class(c)
write_string(f, '</doc>\n')
write_string(f, "</doc>\n")
+183 -166
View File
File diff suppressed because it is too large Load Diff
+170 -141
View File
File diff suppressed because it is too large Load Diff
+64 -42
View File
@@ -7,7 +7,7 @@ import shutil
from collections import OrderedDict
EXTRACT_TAGS = ["description", "brief_description", "member", "constant", "theme_item", "link"]
HEADER = '''\
HEADER = """\
# LANGUAGE translation of the Godot Engine class reference.
# Copyright (c) 2007-2020 Juan Linietsky, Ariel Manzur.
# Copyright (c) 2014-2020 Godot Engine contributors (cf. AUTHORS.md).
@@ -24,7 +24,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\\n"
"Content-Transfer-Encoding: 8-bit\\n"
'''
"""
# Some strings used by makerst.py are normally part of the editor translations,
# so we need to include them manually here for the online docs.
BASE_STRINGS = [
@@ -42,7 +42,8 @@ BASE_STRINGS = [
## <xml-line-number-hack from="https://stackoverflow.com/a/36430270/10846399">
import sys
sys.modules['_elementtree'] = None
sys.modules["_elementtree"] = None
import xml.etree.ElementTree as ET
## override the parser to get the line number
@@ -62,8 +63,11 @@ class LineNumberingParser(ET.XMLParser):
element._end_column_number = self.parser.CurrentColumnNumber
element._end_byte_index = self.parser.CurrentByteIndex
return element
## </xml-line-number-hack>
class Desc:
def __init__(self, line_no, msg, desc_list=None):
## line_no : the line number where the desc is
@@ -73,6 +77,7 @@ class Desc:
self.msg = msg
self.desc_list = desc_list
class DescList:
def __init__(self, doc, path):
## doc : root xml element of the document
@@ -82,29 +87,32 @@ class DescList:
self.path = path
self.list = []
def print_error(error):
print("ERROR: {}".format(error))
## build classes with xml elements recursively
def _collect_classes_dir(path, classes):
if not os.path.isdir(path):
print_error("Invalid directory path: {}".format(path))
exit(1)
for _dir in map(lambda dir : os.path.join(path, dir), os.listdir(path)):
for _dir in map(lambda dir: os.path.join(path, dir), os.listdir(path)):
if os.path.isdir(_dir):
_collect_classes_dir(_dir, classes)
elif os.path.isfile(_dir):
if not _dir.endswith(".xml"):
#print("Got non-.xml file '{}', skipping.".format(path))
# print("Got non-.xml file '{}', skipping.".format(path))
continue
_collect_classes_file(_dir, classes)
## opens a file and parse xml add to classes
def _collect_classes_file(path, classes):
if not os.path.isfile(path) or not path.endswith(".xml"):
print_error("Invalid xml file path: {}".format(path))
exit(1)
print('Collecting file: {}'.format(os.path.basename(path)))
print("Collecting file: {}".format(os.path.basename(path)))
try:
tree = ET.parse(path, parser=LineNumberingParser())
@@ -114,8 +122,8 @@ def _collect_classes_file(path, classes):
doc = tree.getroot()
if 'name' in doc.attrib:
if 'version' not in doc.attrib:
if "name" in doc.attrib:
if "version" not in doc.attrib:
print_error("Version missing from 'doc', file: {}".format(path))
name = doc.attrib["name"]
@@ -124,7 +132,7 @@ def _collect_classes_file(path, classes):
exit(1)
classes[name] = DescList(doc, path)
else:
print_error('Unknown XML file {}, skipping'.format(path))
print_error("Unknown XML file {}, skipping".format(path))
## regions are list of tuples with size 3 (start_index, end_index, indent)
@@ -132,56 +140,64 @@ def _collect_classes_file(path, classes):
## if i inside the region returns the indent, else returns -1
def _get_xml_indent(i, regions):
for region in regions:
if region[0] < i < region[1] :
if region[0] < i < region[1]:
return region[2]
return -1
## find and build all regions of codeblock which we need later
def _make_codeblock_regions(desc, path=''):
def _make_codeblock_regions(desc, path=""):
code_block_end = False
code_block_index = 0
code_block_regions = []
while not code_block_end:
code_block_index = desc.find("[codeblock]", code_block_index)
if code_block_index < 0: break
xml_indent=0
while True :
if code_block_index < 0:
break
xml_indent = 0
while True:
## [codeblock] always have a trailing new line and some tabs
## those tabs are belongs to xml indentations not code indent
if desc[code_block_index+len("[codeblock]\n")+xml_indent] == '\t':
xml_indent+=1
else: break
if desc[code_block_index + len("[codeblock]\n") + xml_indent] == "\t":
xml_indent += 1
else:
break
end_index = desc.find("[/codeblock]", code_block_index)
if end_index < 0 :
print_error('Non terminating codeblock: {}'.format(path))
if end_index < 0:
print_error("Non terminating codeblock: {}".format(path))
exit(1)
code_block_regions.append( (code_block_index, end_index, xml_indent) )
code_block_regions.append((code_block_index, end_index, xml_indent))
code_block_index += 1
return code_block_regions
def _strip_and_split_desc(desc, code_block_regions):
desc_strip = '' ## a stripped desc msg
desc_strip = "" ## a stripped desc msg
total_indent = 0 ## code indent = total indent - xml indent
for i in range(len(desc)):
c = desc[i]
if c == '\n' : c = '\\n'
if c == '"': c = '\\"'
if c == '\\': c = '\\\\' ## <element \> is invalid for msgmerge
if c == '\t':
if c == "\n":
c = "\\n"
if c == '"':
c = '\\"'
if c == "\\":
c = "\\\\" ## <element \> is invalid for msgmerge
if c == "\t":
xml_indent = _get_xml_indent(i, code_block_regions)
if xml_indent >= 0:
total_indent += 1
if xml_indent < total_indent:
c = '\\t'
c = "\\t"
else:
continue
else:
continue
desc_strip += c
if c == '\\n':
if c == "\\n":
total_indent = 0
return desc_strip
## make catalog strings from xml elements
def _make_translation_catalog(classes):
unique_msgs = OrderedDict()
@@ -189,8 +205,9 @@ def _make_translation_catalog(classes):
desc_list = classes[class_name]
for elem in desc_list.doc.iter():
if elem.tag in EXTRACT_TAGS:
if not elem.text or len(elem.text) == 0 : continue
line_no = elem._start_line_number if elem.text[0]!='\n' else elem._start_line_number+1
if not elem.text or len(elem.text) == 0:
continue
line_no = elem._start_line_number if elem.text[0] != "\n" else elem._start_line_number + 1
desc_str = elem.text.strip()
code_block_regions = _make_codeblock_regions(desc_str, desc_list.path)
desc_msg = _strip_and_split_desc(desc_str, code_block_regions)
@@ -203,44 +220,48 @@ def _make_translation_catalog(classes):
unique_msgs[desc_msg].append(desc_obj)
return unique_msgs
## generate the catalog file
def _generate_translation_catalog_file(unique_msgs, output):
with open(output, 'w', encoding='utf8') as f:
with open(output, "w", encoding="utf8") as f:
f.write(HEADER)
for msg in BASE_STRINGS:
f.write('#: doc/tools/makerst.py\n')
f.write("#: doc/tools/makerst.py\n")
f.write('msgid "{}"\n'.format(msg))
f.write('msgstr ""\n\n')
for msg in unique_msgs:
if len(msg) == 0 or msg in BASE_STRINGS:
continue
f.write('#:')
f.write("#:")
desc_list = unique_msgs[msg]
for desc in desc_list:
path = desc.desc_list.path.replace('\\', '/')
if path.startswith('./'):
path = desc.desc_list.path.replace("\\", "/")
if path.startswith("./"):
path = path[2:]
f.write(' {}:{}'.format(path, desc.line_no))
f.write('\n')
f.write(" {}:{}".format(path, desc.line_no))
f.write("\n")
f.write('msgid "{}"\n'.format(msg))
f.write('msgstr ""\n\n')
## TODO: what if 'nt'?
if (os.name == "posix"):
if os.name == "posix":
print("Wrapping template at 79 characters for compatibility with Weblate.")
os.system("msgmerge -w79 {0} {0} > {0}.wrap".format(output))
shutil.move("{}.wrap".format(output), output)
def main():
parser = argparse.ArgumentParser()
parser.add_argument("--path", "-p", nargs="+", default=".", help="The directory or directories containing XML files to collect.")
parser.add_argument(
"--path", "-p", nargs="+", default=".", help="The directory or directories containing XML files to collect."
)
parser.add_argument("--output", "-o", default="translation_catalog.pot", help="The path to the output file.")
args = parser.parse_args()
output = os.path.abspath(args.output)
if not os.path.isdir(os.path.dirname(output)) or not output.endswith('.pot'):
if not os.path.isdir(os.path.dirname(output)) or not output.endswith(".pot"):
print_error("Invalid output path: {}".format(output))
exit(1)
@@ -252,13 +273,14 @@ def main():
print("\nCurrent working dir: {}".format(path))
path_classes = OrderedDict() ## dictionary of key=class_name, value=DescList objects
path_classes = OrderedDict() ## dictionary of key=class_name, value=DescList objects
_collect_classes_dir(path, path_classes)
classes.update(path_classes)
classes = OrderedDict(sorted(classes.items(), key = lambda kv: kv[0].lower()))
classes = OrderedDict(sorted(classes.items(), key=lambda kv: kv[0].lower()))
unique_msgs = _make_translation_catalog(classes)
_generate_translation_catalog_file(unique_msgs, output)
if __name__ == '__main__':
if __name__ == "__main__":
main()
+18 -17
View File
@@ -1,41 +1,42 @@
#!/usr/bin/env python
Import('env')
Import("env")
env.drivers_sources = []
# OS drivers
SConscript('unix/SCsub')
SConscript('windows/SCsub')
SConscript("unix/SCsub")
SConscript("windows/SCsub")
# Sounds drivers
SConscript('alsa/SCsub')
SConscript('coreaudio/SCsub')
SConscript('pulseaudio/SCsub')
if (env["platform"] == "windows"):
SConscript("alsa/SCsub")
SConscript("coreaudio/SCsub")
SConscript("pulseaudio/SCsub")
if env["platform"] == "windows":
SConscript("wasapi/SCsub")
if env['xaudio2']:
if env["xaudio2"]:
SConscript("xaudio2/SCsub")
# Midi drivers
SConscript('alsamidi/SCsub')
SConscript('coremidi/SCsub')
SConscript('winmidi/SCsub')
SConscript("alsamidi/SCsub")
SConscript("coremidi/SCsub")
SConscript("winmidi/SCsub")
# Graphics drivers
if (env["platform"] != "server" and env["platform"] != "javascript"):
# SConscript('gles2/SCsub')
SConscript('vulkan/SCsub')
SConscript('gl_context/SCsub')
if env["platform"] != "server" and env["platform"] != "javascript":
# SConscript('gles2/SCsub')
SConscript("vulkan/SCsub")
SConscript("gl_context/SCsub")
else:
SConscript('dummy/SCsub')
SConscript("dummy/SCsub")
# Core dependencies
SConscript("png/SCsub")
SConscript("spirv-reflect/SCsub")
if env['vsproj']:
if env["vsproj"]:
import os
path = os.getcwd()
# Change directory so the path resolves correctly in the function call.
os.chdir("..")
+1 -1
View File
@@ -1,5 +1,5 @@
#!/usr/bin/env python
Import('env')
Import("env")
env.add_source_files(env.drivers_sources, "*.cpp")
+1 -1
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env python
Import('env')
Import("env")
# Driver source files
env.add_source_files(env.drivers_sources, "*.cpp")
+1 -1
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env python
Import('env')
Import("env")
# Driver source files
env.add_source_files(env.drivers_sources, "*.cpp")
+1 -1
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env python
Import('env')
Import("env")
# Driver source files
env.add_source_files(env.drivers_sources, "*.cpp")
+1 -1
View File
@@ -1,5 +1,5 @@
#!/usr/bin/env python
Import('env')
Import("env")
env.add_source_files(env.drivers_sources, "*.cpp")
+4 -4
View File
@@ -1,8 +1,8 @@
#!/usr/bin/env python
Import('env')
Import("env")
if (env["platform"] in ["haiku", "osx", "windows", "linuxbsd"]):
if env["platform"] in ["haiku", "osx", "windows", "linuxbsd"]:
# Thirdparty source files
thirdparty_dir = "#thirdparty/glad/"
thirdparty_sources = [
@@ -12,8 +12,8 @@ if (env["platform"] in ["haiku", "osx", "windows", "linuxbsd"]):
env.Prepend(CPPPATH=[thirdparty_dir])
env.Append(CPPDEFINES=['GLAD_ENABLED'])
env.Append(CPPDEFINES=['GLES_OVER_GL'])
env.Append(CPPDEFINES=["GLAD_ENABLED"])
env.Append(CPPDEFINES=["GLES_OVER_GL"])
env_thirdparty = env.Clone()
env_thirdparty.disable_warnings()
+1 -1
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env python
Import('env')
Import("env")
env.add_source_files(env.drivers_sources, "*.cpp")
+20 -20
View File
@@ -1,23 +1,23 @@
#!/usr/bin/env python
Import('env')
Import("env")
if 'GLES2_GLSL' in env['BUILDERS']:
env.GLES2_GLSL('copy.glsl');
# env.GLES2_GLSL('resolve.glsl');
env.GLES2_GLSL('canvas.glsl');
env.GLES2_GLSL('canvas_shadow.glsl');
env.GLES2_GLSL('scene.glsl');
env.GLES2_GLSL('cubemap_filter.glsl');
env.GLES2_GLSL('cube_to_dp.glsl');
# env.GLES2_GLSL('blend_shape.glsl');
# env.GLES2_GLSL('screen_space_reflection.glsl');
env.GLES2_GLSL('effect_blur.glsl');
# env.GLES2_GLSL('subsurf_scattering.glsl');
# env.GLES2_GLSL('ssao.glsl');
# env.GLES2_GLSL('ssao_minify.glsl');
# env.GLES2_GLSL('ssao_blur.glsl');
# env.GLES2_GLSL('exposure.glsl');
env.GLES2_GLSL('tonemap.glsl');
# env.GLES2_GLSL('particles.glsl');
env.GLES2_GLSL('lens_distorted.glsl');
if "GLES2_GLSL" in env["BUILDERS"]:
env.GLES2_GLSL("copy.glsl")
# env.GLES2_GLSL('resolve.glsl');
env.GLES2_GLSL("canvas.glsl")
env.GLES2_GLSL("canvas_shadow.glsl")
env.GLES2_GLSL("scene.glsl")
env.GLES2_GLSL("cubemap_filter.glsl")
env.GLES2_GLSL("cube_to_dp.glsl")
# env.GLES2_GLSL('blend_shape.glsl');
# env.GLES2_GLSL('screen_space_reflection.glsl');
env.GLES2_GLSL("effect_blur.glsl")
# env.GLES2_GLSL('subsurf_scattering.glsl');
# env.GLES2_GLSL('ssao.glsl');
# env.GLES2_GLSL('ssao_minify.glsl');
# env.GLES2_GLSL('ssao_blur.glsl');
# env.GLES2_GLSL('exposure.glsl');
env.GLES2_GLSL("tonemap.glsl")
# env.GLES2_GLSL('particles.glsl');
env.GLES2_GLSL("lens_distorted.glsl")
+5 -4
View File
@@ -1,11 +1,11 @@
#!/usr/bin/env python
Import('env')
Import("env")
env_png = env.Clone()
# Thirdparty source files
if env['builtin_libpng']:
if env["builtin_libpng"]:
thirdparty_dir = "#thirdparty/libpng/"
thirdparty_sources = [
"png.c",
@@ -32,6 +32,7 @@ if env['builtin_libpng']:
# Currently .ASM filter_neon.S does not compile on NT.
import os
use_neon = "neon_enabled" in env and env["neon_enabled"] and os.name != "nt"
if use_neon:
env_png.Append(CPPDEFINES=[("PNG_ARM_NEON_OPT", 2)])
@@ -45,7 +46,7 @@ if env['builtin_libpng']:
if use_neon:
env_neon = env_thirdparty.Clone()
if "S_compiler" in env:
env_neon['CC'] = env['S_compiler']
env_neon["CC"] = env["S_compiler"]
neon_sources = []
neon_sources.append(env_neon.Object(thirdparty_dir + "/arm/arm_init.c"))
neon_sources.append(env_neon.Object(thirdparty_dir + "/arm/filter_neon_intrinsics.c"))
@@ -56,4 +57,4 @@ if env['builtin_libpng']:
# Godot source files
env_png.add_source_files(env.drivers_sources, "*.cpp")
Export('env')
Export("env")
+1 -1
View File
@@ -1,5 +1,5 @@
#!/usr/bin/env python
Import('env')
Import("env")
env.add_source_files(env.drivers_sources, "*.cpp")
+3 -3
View File
@@ -1,17 +1,17 @@
#!/usr/bin/env python
Import('env')
Import("env")
env_spirv_reflect = env.Clone()
env_spirv_reflect.disable_warnings()
thirdparty_dir = "#thirdparty/spirv-reflect/"
thirdparty_sources = [
"spirv_reflect.c"
"spirv_reflect.c",
]
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
env_spirv_reflect.add_source_files(env.drivers_sources, thirdparty_sources)
Export('env')
Export("env")
+2 -2
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
Import('env')
Import("env")
env.add_source_files(env.drivers_sources, "*.cpp")
env["check_c_headers"] = [ [ "mntent.h", "HAVE_MNTENT" ] ]
env["check_c_headers"] = [["mntent.h", "HAVE_MNTENT"]]
+48 -40
View File
@@ -1,10 +1,10 @@
#!/usr/bin/env python
Import('env')
Import("env")
env.add_source_files(env.drivers_sources, "*.cpp")
if env['builtin_vulkan']:
if env["builtin_vulkan"]:
# Use bundled Vulkan headers
thirdparty_dir = "#thirdparty/vulkan"
env.Prepend(CPPPATH=[thirdparty_dir, thirdparty_dir + "/include", thirdparty_dir + "/loader"])
@@ -27,48 +27,56 @@ if env['builtin_vulkan']:
]
vma_sources = [thirdparty_dir + "/vk_mem_alloc.cpp"]
if env['platform'] == "windows":
if env["platform"] == "windows":
loader_sources.append("dirent_on_windows.c")
loader_sources.append("dxgi_loader.c")
env_thirdparty.AppendUnique(CPPDEFINES=[
'VK_USE_PLATFORM_WIN32_KHR',
'VULKAN_NON_CMAKE_BUILD',
'WIN32_LEAN_AND_MEAN',
'API_NAME=\\"%s\\"' % 'Vulkan'
])
if not env.msvc: # Windows 7+, missing in mingw headers
env_thirdparty.AppendUnique(CPPDEFINES=[
"CM_GETIDLIST_FILTER_CLASS=0x00000200",
"CM_GETIDLIST_FILTER_PRESENT=0x00000100"
])
elif env['platform'] == "osx":
env_thirdparty.AppendUnique(CPPDEFINES=[
'VK_USE_PLATFORM_MACOS_MVK',
'VULKAN_NON_CMAKE_BUILD',
'SYSCONFDIR=\\"%s\\"' % '/etc',
'FALLBACK_DATA_DIRS=\\"%s\\"' % '/usr/local/share:/usr/share',
'FALLBACK_CONFIG_DIRS=\\"%s\\"' % '/etc/xdg'
])
elif env['platform'] == "iphone":
env_thirdparty.AppendUnique(CPPDEFINES=[
'VK_USE_PLATFORM_IOS_MVK',
'VULKAN_NON_CMAKE_BUILD',
'SYSCONFDIR=\\"%s\\"' % '/etc',
'FALLBACK_DATA_DIRS=\\"%s\\"' % '/usr/local/share:/usr/share',
'FALLBACK_CONFIG_DIRS=\\"%s\\"' % '/etc/xdg'
])
elif env['platform'] == "linuxbsd":
env_thirdparty.AppendUnique(CPPDEFINES=[
'VK_USE_PLATFORM_XLIB_KHR',
'VULKAN_NON_CMAKE_BUILD',
'SYSCONFDIR=\\"%s\\"' % '/etc',
'FALLBACK_DATA_DIRS=\\"%s\\"' % '/usr/local/share:/usr/share',
'FALLBACK_CONFIG_DIRS=\\"%s\\"' % '/etc/xdg'
])
env_thirdparty.AppendUnique(
CPPDEFINES=[
"VK_USE_PLATFORM_WIN32_KHR",
"VULKAN_NON_CMAKE_BUILD",
"WIN32_LEAN_AND_MEAN",
'API_NAME=\\"%s\\"' % "Vulkan",
]
)
if not env.msvc: # Windows 7+, missing in mingw headers
env_thirdparty.AppendUnique(
CPPDEFINES=["CM_GETIDLIST_FILTER_CLASS=0x00000200", "CM_GETIDLIST_FILTER_PRESENT=0x00000100"]
)
elif env["platform"] == "osx":
env_thirdparty.AppendUnique(
CPPDEFINES=[
"VK_USE_PLATFORM_MACOS_MVK",
"VULKAN_NON_CMAKE_BUILD",
'SYSCONFDIR=\\"%s\\"' % "/etc",
'FALLBACK_DATA_DIRS=\\"%s\\"' % "/usr/local/share:/usr/share",
'FALLBACK_CONFIG_DIRS=\\"%s\\"' % "/etc/xdg",
]
)
elif env["platform"] == "iphone":
env_thirdparty.AppendUnique(
CPPDEFINES=[
"VK_USE_PLATFORM_IOS_MVK",
"VULKAN_NON_CMAKE_BUILD",
'SYSCONFDIR=\\"%s\\"' % "/etc",
'FALLBACK_DATA_DIRS=\\"%s\\"' % "/usr/local/share:/usr/share",
'FALLBACK_CONFIG_DIRS=\\"%s\\"' % "/etc/xdg",
]
)
elif env["platform"] == "linuxbsd":
env_thirdparty.AppendUnique(
CPPDEFINES=[
"VK_USE_PLATFORM_XLIB_KHR",
"VULKAN_NON_CMAKE_BUILD",
'SYSCONFDIR=\\"%s\\"' % "/etc",
'FALLBACK_DATA_DIRS=\\"%s\\"' % "/usr/local/share:/usr/share",
'FALLBACK_CONFIG_DIRS=\\"%s\\"' % "/etc/xdg",
]
)
import platform
if (platform.system() == "Linux"):
if platform.system() == "Linux":
# In glibc since 2.17 and musl libc since 1.1.24. Used by loader.c.
env_thirdparty.AppendUnique(CPPDEFINES=['HAVE_SECURE_GETENV'])
env_thirdparty.AppendUnique(CPPDEFINES=["HAVE_SECURE_GETENV"])
loader_sources = [thirdparty_dir + "/loader/" + file for file in loader_sources]
env_thirdparty.add_source_files(env.drivers_sources, loader_sources)
+1 -1
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env python
Import('env')
Import("env")
# Driver source files
env.add_source_files(env.drivers_sources, "*.cpp")
+1 -1
View File
@@ -1,5 +1,5 @@
#!/usr/bin/env python
Import('env')
Import("env")
env.add_source_files(env.drivers_sources, "*.cpp")
+1 -1
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env python
Import('env')
Import("env")
# Driver source files
env.add_source_files(env.drivers_sources, "*.cpp")
+3 -3
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
Import('env')
Import("env")
env.add_source_files(env.drivers_sources, "*.cpp")
env.Append(CPPDEFINES=['XAUDIO2_ENABLED'])
env.Append(LINKFLAGS=['xaudio2_8.lib'])
env.Append(CPPDEFINES=["XAUDIO2_ENABLED"])
env.Append(LINKFLAGS=["xaudio2_8.lib"])
+25 -21
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env python
Import('env')
Import("env")
env.editor_sources = []
@@ -16,24 +16,24 @@ def _make_doc_data_class_path(to_path):
g.write("static const int _doc_data_class_path_count = " + str(len(env.doc_class_path)) + ";\n")
g.write("struct _DocDataClassPath { const char* name; const char* path; };\n")
g.write("static const _DocDataClassPath _doc_data_class_paths[" + str(len(env.doc_class_path) + 1) + "] = {\n");
g.write("static const _DocDataClassPath _doc_data_class_paths[" + str(len(env.doc_class_path) + 1) + "] = {\n")
for c in sorted(env.doc_class_path):
g.write("\t{\"" + c + "\", \"" + env.doc_class_path[c] + "\"},\n")
g.write('\t{"' + c + '", "' + env.doc_class_path[c] + '"},\n')
g.write("\t{NULL, NULL}\n")
g.write("};\n")
g.close()
if env['tools']:
if env["tools"]:
# Register exporters
reg_exporters_inc = '#include "register_exporters.h"\n'
reg_exporters = 'void register_exporters() {\n'
reg_exporters = "void register_exporters() {\n"
for e in env.platform_exporters:
env.add_source_files(env.editor_sources, "#platform/" + e + "/export/export.cpp")
reg_exporters += '\tregister_' + e + '_exporter();\n'
reg_exporters += "\tregister_" + e + "_exporter();\n"
reg_exporters_inc += '#include "platform/' + e + '/export/export.h"\n'
reg_exporters += '}\n'
reg_exporters += "}\n"
# NOTE: It is safe to generate this file here, since this is still executed serially
with open("register_exporters.gen.cpp", "w", encoding="utf-8") as f:
@@ -50,12 +50,12 @@ if env['tools']:
for d in doc_dirs:
try:
for f in os.listdir(os.path.join(env.Dir('#').abspath, d)):
for f in os.listdir(os.path.join(env.Dir("#").abspath, d)):
docs.append("#" + os.path.join(d, f))
except OSError:
pass
_make_doc_data_class_path(os.path.join(env.Dir('#').abspath, "editor"))
_make_doc_data_class_path(os.path.join(env.Dir("#").abspath, "editor"))
docs = sorted(docs)
env.Depends("#editor/doc_data_compressed.gen.h", docs)
@@ -63,32 +63,36 @@ if env['tools']:
import glob
path = env.Dir('.').abspath
path = env.Dir(".").abspath
# Editor translations
tlist = glob.glob(path + "/translations/*.po")
env.Depends('#editor/editor_translations.gen.h', tlist)
env.CommandNoCache('#editor/editor_translations.gen.h', tlist, run_in_subprocess(editor_builders.make_editor_translations_header))
env.Depends("#editor/editor_translations.gen.h", tlist)
env.CommandNoCache(
"#editor/editor_translations.gen.h", tlist, run_in_subprocess(editor_builders.make_editor_translations_header)
)
# Documentation translations
tlist = glob.glob(env.Dir("#doc").abspath + "/translations/*.po")
env.Depends('#editor/doc_translations.gen.h', tlist)
env.CommandNoCache('#editor/doc_translations.gen.h', tlist, run_in_subprocess(editor_builders.make_doc_translations_header))
env.Depends("#editor/doc_translations.gen.h", tlist)
env.CommandNoCache(
"#editor/doc_translations.gen.h", tlist, run_in_subprocess(editor_builders.make_doc_translations_header)
)
# Fonts
flist = glob.glob(path + "/../thirdparty/fonts/*.ttf")
flist.extend(glob.glob(path + "/../thirdparty/fonts/*.otf"))
flist.sort()
env.Depends('#editor/builtin_fonts.gen.h', flist)
env.CommandNoCache('#editor/builtin_fonts.gen.h', flist, run_in_subprocess(editor_builders.make_fonts_header))
env.Depends("#editor/builtin_fonts.gen.h", flist)
env.CommandNoCache("#editor/builtin_fonts.gen.h", flist, run_in_subprocess(editor_builders.make_fonts_header))
env.add_source_files(env.editor_sources, "*.cpp")
SConscript('debugger/SCsub')
SConscript('fileserver/SCsub')
SConscript('icons/SCsub')
SConscript('import/SCsub')
SConscript('plugins/SCsub')
SConscript("debugger/SCsub")
SConscript("fileserver/SCsub")
SConscript("icons/SCsub")
SConscript("import/SCsub")
SConscript("plugins/SCsub")
lib = env.add_library("editor", env.editor_sources)
env.Prepend(LIBS=[lib])
+1 -1
View File
@@ -1,5 +1,5 @@
#!/usr/bin/env python
Import('env')
Import("env")
env.add_source_files(env.editor_sources, "*.cpp")
+6 -3
View File
@@ -25,6 +25,7 @@ def make_doc_header(target, source, env):
buf = (docbegin + buf + docend).encode("utf-8")
decomp_size = len(buf)
import zlib
buf = zlib.compress(buf)
g.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n")
@@ -55,7 +56,7 @@ def make_fonts_header(target, source, env):
# saving uncompressed, since freetype will reference from memory pointer
xl_names = []
for i in range(len(source)):
with open(source[i], "rb")as f:
with open(source[i], "rb") as f:
buf = f.read()
name = os.path.splitext(os.path.basename(source[i]))[0]
@@ -111,7 +112,9 @@ def make_translations_header(target, source, env, category):
g.write("};\n\n")
g.write("static {}TranslationList _{}_translations[] = {{\n".format(category.capitalize(), category))
for x in xl_names:
g.write("\t{{ \"{}\", {}, {}, _{}_translation_{}_compressed }},\n".format(x[0], str(x[1]), str(x[2]), category, x[0]))
g.write(
'\t{{ "{}", {}, {}, _{}_translation_{}_compressed }},\n'.format(x[0], str(x[1]), str(x[2]), category, x[0])
)
g.write("\t{NULL, 0, 0, NULL}\n")
g.write("};\n")
@@ -128,5 +131,5 @@ def make_doc_translations_header(target, source, env):
make_translations_header(target, source, env, "doc")
if __name__ == '__main__':
if __name__ == "__main__":
subprocess_main(globals())
+1 -1
View File
@@ -1,5 +1,5 @@
#!/usr/bin/env python
Import('env')
Import("env")
env.add_source_files(env.editor_sources, "*.cpp")
+7 -7
View File
@@ -1,21 +1,21 @@
#!/usr/bin/env python
Import('env')
Import("env")
from platform_methods import run_in_subprocess
import editor_icons_builders
make_editor_icons_builder = Builder(action=run_in_subprocess(editor_icons_builders.make_editor_icons_action),
suffix='.h',
src_suffix='.svg')
make_editor_icons_builder = Builder(
action=run_in_subprocess(editor_icons_builders.make_editor_icons_action), suffix=".h", src_suffix=".svg"
)
env['BUILDERS']['MakeEditorIconsBuilder'] = make_editor_icons_builder
env["BUILDERS"]["MakeEditorIconsBuilder"] = make_editor_icons_builder
# Editor's own icons
icon_sources = Glob("*.svg")
# Module icons
for module_icons in env.module_icons_paths:
icon_sources += Glob('#' + module_icons + "/*.svg")
icon_sources += Glob("#" + module_icons + "/*.svg")
env.Alias('editor_icons', [env.MakeEditorIconsBuilder('#editor/editor_icons.gen.h', icon_sources)])
env.Alias("editor_icons", [env.MakeEditorIconsBuilder("#editor/editor_icons.gen.h", icon_sources)])
+7 -7
View File
@@ -22,16 +22,16 @@ def make_editor_icons_action(target, source, env):
icons_string.write('\t"')
with open(fname, 'rb') as svgf:
with open(fname, "rb") as svgf:
b = svgf.read(1)
while(len(b) == 1):
while len(b) == 1:
icons_string.write("\\" + str(hex(ord(b)))[1:])
b = svgf.read(1)
icons_string.write('"')
if fname != svg_icons[-1]:
icons_string.write(",")
icons_string.write('\n')
icons_string.write("\n")
s = StringIO()
s.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n")
@@ -40,7 +40,7 @@ def make_editor_icons_action(target, source, env):
s.write("static const int editor_icons_count = {};\n".format(len(svg_icons)))
s.write("static const char *editor_icons_sources[] = {\n")
s.write(icons_string.getvalue())
s.write('};\n\n')
s.write("};\n\n")
s.write("static const char *editor_icons_names[] = {\n")
# this is used to store the indices of thumbnail icons
@@ -63,11 +63,11 @@ def make_editor_icons_action(target, source, env):
if fname != svg_icons[-1]:
s.write(",")
s.write('\n')
s.write("\n")
index += 1
s.write('};\n')
s.write("};\n")
if thumb_medium_indices:
s.write("\n\n")
@@ -91,5 +91,5 @@ def make_editor_icons_action(target, source, env):
icons_string.close()
if __name__ == '__main__':
if __name__ == "__main__":
subprocess_main(globals())
+1 -1
View File
@@ -1,5 +1,5 @@
#!/usr/bin/env python
Import('env')
Import("env")
env.add_source_files(env.editor_sources, "*.cpp")
+1 -1
View File
@@ -1,5 +1,5 @@
#!/usr/bin/env python
Import('env')
Import("env")
env.add_source_files(env.editor_sources, "*.cpp")
+21 -19
View File
@@ -10,23 +10,23 @@ import sys
line_nb = False
for arg in sys.argv[1:]:
if (arg == "--with-line-nb"):
if arg == "--with-line-nb":
print("Enabling line numbers in the context locations.")
line_nb = True
else:
os.sys.exit("Non supported argument '" + arg + "'. Aborting.")
if (not os.path.exists("editor")):
if not os.path.exists("editor"):
os.sys.exit("ERROR: This script should be started from the root of the git repo.")
matches = []
for root, dirnames, filenames in os.walk('.'):
for root, dirnames, filenames in os.walk("."):
dirnames[:] = [d for d in dirnames if d not in ["thirdparty"]]
for filename in fnmatch.filter(filenames, '*.cpp'):
for filename in fnmatch.filter(filenames, "*.cpp"):
matches.append(os.path.join(root, filename))
for filename in fnmatch.filter(filenames, '*.h'):
for filename in fnmatch.filter(filenames, "*.h"):
matches.append(os.path.join(root, filename))
matches.sort()
@@ -51,52 +51,54 @@ msgstr ""
"Content-Transfer-Encoding: 8-bit\\n"
"""
def process_file(f, fname):
global main_po, unique_str, unique_loc
l = f.readline()
lc = 1
while (l):
while l:
patterns = ['RTR(\"', 'TTR(\"', 'TTRC(\"']
patterns = ['RTR("', 'TTR("', 'TTRC("']
idx = 0
pos = 0
while (pos >= 0):
while pos >= 0:
pos = l.find(patterns[idx], pos)
if (pos == -1):
if (idx < len(patterns) - 1):
if pos == -1:
if idx < len(patterns) - 1:
idx += 1
pos = 0
continue
pos += len(patterns[idx])
msg = ""
while (pos < len(l) and (l[pos] != '"' or l[pos - 1] == '\\')):
while pos < len(l) and (l[pos] != '"' or l[pos - 1] == "\\"):
msg += l[pos]
pos += 1
location = os.path.relpath(fname).replace('\\', '/')
if (line_nb):
location = os.path.relpath(fname).replace("\\", "/")
if line_nb:
location += ":" + str(lc)
if (not msg in unique_str):
if not msg in unique_str:
main_po += "\n#: " + location + "\n"
main_po += 'msgid "' + msg + '"\n'
main_po += 'msgstr ""\n'
unique_str.append(msg)
unique_loc[msg] = [location]
elif (not location in unique_loc[msg]):
elif not location in unique_loc[msg]:
# Add additional location to previous occurrence too
msg_pos = main_po.find('\nmsgid "' + msg + '"')
if (msg_pos == -1):
if msg_pos == -1:
print("Someone apparently thought writing Python was as easy as GDScript. Ping Akien.")
main_po = main_po[:msg_pos] + ' ' + location + main_po[msg_pos:]
main_po = main_po[:msg_pos] + " " + location + main_po[msg_pos:]
unique_loc[msg].append(location)
l = f.readline()
lc += 1
print("Updating the editor.pot template...")
for fname in matches:
@@ -106,7 +108,7 @@ for fname in matches:
with open("editor.pot", "w") as f:
f.write(main_po)
if (os.name == "posix"):
if os.name == "posix":
print("Wrapping template at 79 characters for compatibility with Weblate.")
os.system("msgmerge -w79 editor.pot editor.pot > editor.pot.wrap")
shutil.move("editor.pot.wrap", "editor.pot")
@@ -114,7 +116,7 @@ if (os.name == "posix"):
shutil.move("editor.pot", "editor/translations/editor.pot")
# TODO: Make that in a portable way, if we care; if not, kudos to Unix users
if (os.name == "posix"):
if os.name == "posix":
added = subprocess.check_output(r"git diff editor/translations/editor.pot | grep \+msgid | wc -l", shell=True)
removed = subprocess.check_output(r"git diff editor/translations/editor.pot | grep \\\-msgid | wc -l", shell=True)
print("\n# Template changes compared to the staged status:")
+171 -81
View File
@@ -7,7 +7,6 @@ from platform_methods import subprocess_main
class LegacyGLHeaderStruct:
def __init__(self):
self.vertex_lines = []
self.fragment_lines = []
@@ -73,7 +72,7 @@ def include_file_in_legacygl_header(filename, header_data, depth):
ifdefline = line.replace("#ifdef ", "").strip()
if line.find("_EN_") != -1:
enumbase = ifdefline[:ifdefline.find("_EN_")]
enumbase = ifdefline[: ifdefline.find("_EN_")]
ifdefline = ifdefline.replace("_EN_", "_")
line = line.replace("_EN_", "_")
if enumbase not in header_data.enums:
@@ -86,12 +85,12 @@ def include_file_in_legacygl_header(filename, header_data, depth):
if line.find("uniform") != -1 and line.lower().find("texunit:") != -1:
# texture unit
texunitstr = line[line.find(":") + 1:].strip()
texunitstr = line[line.find(":") + 1 :].strip()
if texunitstr == "auto":
texunit = "-1"
else:
texunit = str(int(texunitstr))
uline = line[:line.lower().find("//")]
uline = line[: line.lower().find("//")]
uline = uline.replace("uniform", "")
uline = uline.replace("highp", "")
uline = uline.replace(";", "")
@@ -99,10 +98,10 @@ def include_file_in_legacygl_header(filename, header_data, depth):
for x in lines:
x = x.strip()
x = x[x.rfind(" ") + 1:]
x = x[x.rfind(" ") + 1 :]
if x.find("[") != -1:
# unfiorm array
x = x[:x.find("[")]
x = x[: x.find("[")]
if not x in header_data.texunit_names:
header_data.texunits += [(x, texunit)]
@@ -110,10 +109,10 @@ def include_file_in_legacygl_header(filename, header_data, depth):
elif line.find("uniform") != -1 and line.lower().find("ubo:") != -1:
# uniform buffer object
ubostr = line[line.find(":") + 1:].strip()
ubostr = line[line.find(":") + 1 :].strip()
ubo = str(int(ubostr))
uline = line[:line.lower().find("//")]
uline = uline[uline.find("uniform") + len("uniform"):]
uline = line[: line.lower().find("//")]
uline = uline[uline.find("uniform") + len("uniform") :]
uline = uline.replace("highp", "")
uline = uline.replace(";", "")
uline = uline.replace("{", "").strip()
@@ -121,10 +120,10 @@ def include_file_in_legacygl_header(filename, header_data, depth):
for x in lines:
x = x.strip()
x = x[x.rfind(" ") + 1:]
x = x[x.rfind(" ") + 1 :]
if x.find("[") != -1:
# unfiorm array
x = x[:x.find("[")]
x = x[: x.find("[")]
if not x in header_data.ubo_names:
header_data.ubos += [(x, ubo)]
@@ -137,10 +136,10 @@ def include_file_in_legacygl_header(filename, header_data, depth):
for x in lines:
x = x.strip()
x = x[x.rfind(" ") + 1:]
x = x[x.rfind(" ") + 1 :]
if x.find("[") != -1:
# unfiorm array
x = x[:x.find("[")]
x = x[: x.find("[")]
if not x in header_data.uniforms:
header_data.uniforms += [x]
@@ -150,7 +149,7 @@ def include_file_in_legacygl_header(filename, header_data, depth):
uline = uline.replace("attribute ", "")
uline = uline.replace("highp ", "")
uline = uline.replace(";", "")
uline = uline[uline.find(" "):].strip()
uline = uline[uline.find(" ") :].strip()
if uline.find("//") != -1:
name, bind = uline.split("//")
@@ -163,7 +162,7 @@ def include_file_in_legacygl_header(filename, header_data, depth):
uline = line.replace("out ", "")
uline = uline.replace("highp ", "")
uline = uline.replace(";", "")
uline = uline[uline.find(" "):].strip()
uline = uline[uline.find(" ") :].strip()
if uline.find("//") != -1:
name, bind = uline.split("//")
@@ -200,17 +199,19 @@ def build_legacygl_header(filename, include, class_suffix, output_attribs, gles2
fd.write("/* WARNING, THIS FILE WAS GENERATED, DO NOT EDIT */\n")
out_file_base = out_file
out_file_base = out_file_base[out_file_base.rfind("/") + 1:]
out_file_base = out_file_base[out_file_base.rfind("\\") + 1:]
out_file_base = out_file_base[out_file_base.rfind("/") + 1 :]
out_file_base = out_file_base[out_file_base.rfind("\\") + 1 :]
out_file_ifdef = out_file_base.replace(".", "_").upper()
fd.write("#ifndef " + out_file_ifdef + class_suffix + "_120\n")
fd.write("#define " + out_file_ifdef + class_suffix + "_120\n")
out_file_class = out_file_base.replace(".glsl.gen.h", "").title().replace("_", "").replace(".", "") + "Shader" + class_suffix
out_file_class = (
out_file_base.replace(".glsl.gen.h", "").title().replace("_", "").replace(".", "") + "Shader" + class_suffix
)
fd.write("\n\n")
fd.write("#include \"" + include + "\"\n\n\n")
fd.write('#include "' + include + '"\n\n\n')
fd.write("class " + out_file_class + " : public Shader" + class_suffix + " {\n\n")
fd.write("\t virtual String get_shader_name() const { return \"" + out_file_class + "\"; }\n")
fd.write('\t virtual String get_shader_name() const { return "' + out_file_class + '"; }\n')
fd.write("public:\n\n")
@@ -228,29 +229,64 @@ def build_legacygl_header(filename, include, class_suffix, output_attribs, gles2
fd.write("\t_FORCE_INLINE_ int get_uniform(Uniforms p_uniform) const { return _get_uniform(p_uniform); }\n\n")
if header_data.conditionals:
fd.write("\t_FORCE_INLINE_ void set_conditional(Conditionals p_conditional,bool p_enable) { _set_conditional(p_conditional,p_enable); }\n\n")
fd.write(
"\t_FORCE_INLINE_ void set_conditional(Conditionals p_conditional,bool p_enable) { _set_conditional(p_conditional,p_enable); }\n\n"
)
fd.write("\t#ifdef DEBUG_ENABLED\n ")
fd.write("\t#define _FU if (get_uniform(p_uniform)<0) return; if (!is_version_valid()) return; ERR_FAIL_COND( get_active()!=this ); \n\n ")
fd.write(
"\t#define _FU if (get_uniform(p_uniform)<0) return; if (!is_version_valid()) return; ERR_FAIL_COND( get_active()!=this ); \n\n "
)
fd.write("\t#else\n ")
fd.write("\t#define _FU if (get_uniform(p_uniform)<0) return; \n\n ")
fd.write("\t#endif\n")
fd.write("\t_FORCE_INLINE_ void set_uniform(Uniforms p_uniform, float p_value) { _FU glUniform1f(get_uniform(p_uniform),p_value); }\n\n")
fd.write("\t_FORCE_INLINE_ void set_uniform(Uniforms p_uniform, double p_value) { _FU glUniform1f(get_uniform(p_uniform),p_value); }\n\n")
fd.write("\t_FORCE_INLINE_ void set_uniform(Uniforms p_uniform, uint8_t p_value) { _FU glUniform1i(get_uniform(p_uniform),p_value); }\n\n")
fd.write("\t_FORCE_INLINE_ void set_uniform(Uniforms p_uniform, int8_t p_value) { _FU glUniform1i(get_uniform(p_uniform),p_value); }\n\n")
fd.write("\t_FORCE_INLINE_ void set_uniform(Uniforms p_uniform, uint16_t p_value) { _FU glUniform1i(get_uniform(p_uniform),p_value); }\n\n")
fd.write("\t_FORCE_INLINE_ void set_uniform(Uniforms p_uniform, int16_t p_value) { _FU glUniform1i(get_uniform(p_uniform),p_value); }\n\n")
fd.write("\t_FORCE_INLINE_ void set_uniform(Uniforms p_uniform, uint32_t p_value) { _FU glUniform1i(get_uniform(p_uniform),p_value); }\n\n")
fd.write("\t_FORCE_INLINE_ void set_uniform(Uniforms p_uniform, int32_t p_value) { _FU glUniform1i(get_uniform(p_uniform),p_value); }\n\n")
fd.write("\t_FORCE_INLINE_ void set_uniform(Uniforms p_uniform, const Color& p_color) { _FU GLfloat col[4]={p_color.r,p_color.g,p_color.b,p_color.a}; glUniform4fv(get_uniform(p_uniform),1,col); }\n\n")
fd.write("\t_FORCE_INLINE_ void set_uniform(Uniforms p_uniform, const Vector2& p_vec2) { _FU GLfloat vec2[2]={p_vec2.x,p_vec2.y}; glUniform2fv(get_uniform(p_uniform),1,vec2); }\n\n")
fd.write("\t_FORCE_INLINE_ void set_uniform(Uniforms p_uniform, const Size2i& p_vec2) { _FU GLint vec2[2]={p_vec2.x,p_vec2.y}; glUniform2iv(get_uniform(p_uniform),1,vec2); }\n\n")
fd.write("\t_FORCE_INLINE_ void set_uniform(Uniforms p_uniform, const Vector3& p_vec3) { _FU GLfloat vec3[3]={p_vec3.x,p_vec3.y,p_vec3.z}; glUniform3fv(get_uniform(p_uniform),1,vec3); }\n\n")
fd.write("\t_FORCE_INLINE_ void set_uniform(Uniforms p_uniform, float p_a, float p_b) { _FU glUniform2f(get_uniform(p_uniform),p_a,p_b); }\n\n")
fd.write("\t_FORCE_INLINE_ void set_uniform(Uniforms p_uniform, float p_a, float p_b, float p_c) { _FU glUniform3f(get_uniform(p_uniform),p_a,p_b,p_c); }\n\n")
fd.write("\t_FORCE_INLINE_ void set_uniform(Uniforms p_uniform, float p_a, float p_b, float p_c, float p_d) { _FU glUniform4f(get_uniform(p_uniform),p_a,p_b,p_c,p_d); }\n\n")
fd.write(
"\t_FORCE_INLINE_ void set_uniform(Uniforms p_uniform, float p_value) { _FU glUniform1f(get_uniform(p_uniform),p_value); }\n\n"
)
fd.write(
"\t_FORCE_INLINE_ void set_uniform(Uniforms p_uniform, double p_value) { _FU glUniform1f(get_uniform(p_uniform),p_value); }\n\n"
)
fd.write(
"\t_FORCE_INLINE_ void set_uniform(Uniforms p_uniform, uint8_t p_value) { _FU glUniform1i(get_uniform(p_uniform),p_value); }\n\n"
)
fd.write(
"\t_FORCE_INLINE_ void set_uniform(Uniforms p_uniform, int8_t p_value) { _FU glUniform1i(get_uniform(p_uniform),p_value); }\n\n"
)
fd.write(
"\t_FORCE_INLINE_ void set_uniform(Uniforms p_uniform, uint16_t p_value) { _FU glUniform1i(get_uniform(p_uniform),p_value); }\n\n"
)
fd.write(
"\t_FORCE_INLINE_ void set_uniform(Uniforms p_uniform, int16_t p_value) { _FU glUniform1i(get_uniform(p_uniform),p_value); }\n\n"
)
fd.write(
"\t_FORCE_INLINE_ void set_uniform(Uniforms p_uniform, uint32_t p_value) { _FU glUniform1i(get_uniform(p_uniform),p_value); }\n\n"
)
fd.write(
"\t_FORCE_INLINE_ void set_uniform(Uniforms p_uniform, int32_t p_value) { _FU glUniform1i(get_uniform(p_uniform),p_value); }\n\n"
)
fd.write(
"\t_FORCE_INLINE_ void set_uniform(Uniforms p_uniform, const Color& p_color) { _FU GLfloat col[4]={p_color.r,p_color.g,p_color.b,p_color.a}; glUniform4fv(get_uniform(p_uniform),1,col); }\n\n"
)
fd.write(
"\t_FORCE_INLINE_ void set_uniform(Uniforms p_uniform, const Vector2& p_vec2) { _FU GLfloat vec2[2]={p_vec2.x,p_vec2.y}; glUniform2fv(get_uniform(p_uniform),1,vec2); }\n\n"
)
fd.write(
"\t_FORCE_INLINE_ void set_uniform(Uniforms p_uniform, const Size2i& p_vec2) { _FU GLint vec2[2]={p_vec2.x,p_vec2.y}; glUniform2iv(get_uniform(p_uniform),1,vec2); }\n\n"
)
fd.write(
"\t_FORCE_INLINE_ void set_uniform(Uniforms p_uniform, const Vector3& p_vec3) { _FU GLfloat vec3[3]={p_vec3.x,p_vec3.y,p_vec3.z}; glUniform3fv(get_uniform(p_uniform),1,vec3); }\n\n"
)
fd.write(
"\t_FORCE_INLINE_ void set_uniform(Uniforms p_uniform, float p_a, float p_b) { _FU glUniform2f(get_uniform(p_uniform),p_a,p_b); }\n\n"
)
fd.write(
"\t_FORCE_INLINE_ void set_uniform(Uniforms p_uniform, float p_a, float p_b, float p_c) { _FU glUniform3f(get_uniform(p_uniform),p_a,p_b,p_c); }\n\n"
)
fd.write(
"\t_FORCE_INLINE_ void set_uniform(Uniforms p_uniform, float p_a, float p_b, float p_c, float p_d) { _FU glUniform4f(get_uniform(p_uniform),p_a,p_b,p_c,p_d); }\n\n"
)
fd.write("""\t_FORCE_INLINE_ void set_uniform(Uniforms p_uniform, const Transform& p_transform) { _FU
fd.write(
"""\t_FORCE_INLINE_ void set_uniform(Uniforms p_uniform, const Transform& p_transform) { _FU
const Transform &tr = p_transform;
@@ -276,9 +312,11 @@ def build_legacygl_header(filename, include, class_suffix, output_attribs, gles2
glUniformMatrix4fv(get_uniform(p_uniform),1,false,matrix);
}
""")
"""
)
fd.write("""_FORCE_INLINE_ void set_uniform(Uniforms p_uniform, const Transform2D& p_transform) { _FU
fd.write(
"""_FORCE_INLINE_ void set_uniform(Uniforms p_uniform, const Transform2D& p_transform) { _FU
const Transform2D &tr = p_transform;
@@ -304,9 +342,11 @@ def build_legacygl_header(filename, include, class_suffix, output_attribs, gles2
glUniformMatrix4fv(get_uniform(p_uniform),1,false,matrix);
}
""")
"""
)
fd.write("""_FORCE_INLINE_ void set_uniform(Uniforms p_uniform, const CameraMatrix& p_matrix) { _FU
fd.write(
"""_FORCE_INLINE_ void set_uniform(Uniforms p_uniform, const CameraMatrix& p_matrix) { _FU
GLfloat matrix[16];
@@ -320,7 +360,8 @@ def build_legacygl_header(filename, include, class_suffix, output_attribs, gles2
glUniformMatrix4fv(get_uniform(p_uniform),1,false,matrix);
}
""")
"""
)
fd.write("\n\n#undef _FU\n\n\n")
@@ -340,21 +381,25 @@ def build_legacygl_header(filename, include, class_suffix, output_attribs, gles2
x = header_data.enums[xv]
bits = 1
amt = len(x)
while (2 ** bits < amt):
while 2 ** bits < amt:
bits += 1
strs = "{"
for i in range(amt):
strs += "\"#define " + x[i] + "\\n\","
strs += '"#define ' + x[i] + '\\n",'
c = {}
c["set_mask"] = "uint64_t(" + str(i) + ")<<" + str(bitofs)
c["clear_mask"] = "((uint64_t(1)<<40)-1) ^ (((uint64_t(1)<<" + str(bits) + ") - 1)<<" + str(bitofs) + ")"
c["clear_mask"] = (
"((uint64_t(1)<<40)-1) ^ (((uint64_t(1)<<" + str(bits) + ") - 1)<<" + str(bitofs) + ")"
)
enum_vals.append(c)
enum_constants.append(x[i])
strs += "NULL}"
fd.write("\t\t\t{(uint64_t(1<<" + str(bits) + ")-1)<<" + str(bitofs) + "," + str(bitofs) + "," + strs + "},\n")
fd.write(
"\t\t\t{(uint64_t(1<<" + str(bits) + ")-1)<<" + str(bitofs) + "," + str(bitofs) + "," + strs + "},\n"
)
bitofs += bits
fd.write("\t\t};\n\n")
@@ -373,7 +418,7 @@ def build_legacygl_header(filename, include, class_suffix, output_attribs, gles2
fd.write("\t\tstatic const char* _conditional_strings[]={\n")
if header_data.conditionals:
for x in header_data.conditionals:
fd.write("\t\t\t\"#define " + x + "\\n\",\n")
fd.write('\t\t\t"#define ' + x + '\\n",\n')
conditionals_found.append(x)
fd.write("\t\t};\n\n")
else:
@@ -384,7 +429,7 @@ def build_legacygl_header(filename, include, class_suffix, output_attribs, gles2
fd.write("\t\tstatic const char* _uniform_strings[]={\n")
if header_data.uniforms:
for x in header_data.uniforms:
fd.write("\t\t\t\"" + x + "\",\n")
fd.write('\t\t\t"' + x + '",\n')
fd.write("\t\t};\n\n")
else:
fd.write("\t\tstatic const char **_uniform_strings=NULL;\n")
@@ -394,7 +439,7 @@ def build_legacygl_header(filename, include, class_suffix, output_attribs, gles2
fd.write("\t\tstatic AttributePair _attribute_pairs[]={\n")
for x in header_data.attributes:
fd.write("\t\t\t{\"" + x[0] + "\"," + x[1] + "},\n")
fd.write('\t\t\t{"' + x[0] + '",' + x[1] + "},\n")
fd.write("\t\t};\n\n")
else:
fd.write("\t\tstatic AttributePair *_attribute_pairs=NULL;\n")
@@ -408,9 +453,9 @@ def build_legacygl_header(filename, include, class_suffix, output_attribs, gles2
name = x[0]
cond = x[1]
if cond in conditionals_found:
fd.write("\t\t\t{\"" + name + "\"," + str(conditionals_found.index(cond)) + "},\n")
fd.write('\t\t\t{"' + name + '",' + str(conditionals_found.index(cond)) + "},\n")
else:
fd.write("\t\t\t{\"" + name + "\",-1},\n")
fd.write('\t\t\t{"' + name + '",-1},\n')
feedback_count += 1
@@ -424,7 +469,7 @@ def build_legacygl_header(filename, include, class_suffix, output_attribs, gles2
if header_data.texunits:
fd.write("\t\tstatic TexUnitPair _texunit_pairs[]={\n")
for x in header_data.texunits:
fd.write("\t\t\t{\"" + x[0] + "\"," + x[1] + "},\n")
fd.write('\t\t\t{"' + x[0] + '",' + x[1] + "},\n")
fd.write("\t\t};\n\n")
else:
fd.write("\t\tstatic TexUnitPair *_texunit_pairs=NULL;\n")
@@ -432,7 +477,7 @@ def build_legacygl_header(filename, include, class_suffix, output_attribs, gles2
if not gles2 and header_data.ubos:
fd.write("\t\tstatic UBOPair _ubo_pairs[]={\n")
for x in header_data.ubos:
fd.write("\t\t\t{\"" + x[0] + "\"," + x[1] + "},\n")
fd.write('\t\t\t{"' + x[0] + '",' + x[1] + "},\n")
fd.write("\t\t};\n\n")
else:
if gles2:
@@ -445,7 +490,7 @@ def build_legacygl_header(filename, include, class_suffix, output_attribs, gles2
for c in x:
fd.write(str(ord(c)) + ",")
fd.write(str(ord('\n')) + ",")
fd.write(str(ord("\n")) + ",")
fd.write("\t\t0};\n\n")
fd.write("\t\tstatic const int _vertex_code_start=" + str(header_data.vertex_offset) + ";\n")
@@ -455,28 +500,73 @@ def build_legacygl_header(filename, include, class_suffix, output_attribs, gles2
for c in x:
fd.write(str(ord(c)) + ",")
fd.write(str(ord('\n')) + ",")
fd.write(str(ord("\n")) + ",")
fd.write("\t\t0};\n\n")
fd.write("\t\tstatic const int _fragment_code_start=" + str(header_data.fragment_offset) + ";\n")
if output_attribs:
if gles2:
fd.write("\t\tsetup(_conditional_strings," + str(len(header_data.conditionals)) + ",_uniform_strings," + str(len(header_data.uniforms)) + ",_attribute_pairs," + str(
len(header_data.attributes)) + ", _texunit_pairs," + str(len(header_data.texunits)) + ",_vertex_code,_fragment_code,_vertex_code_start,_fragment_code_start);\n")
fd.write(
"\t\tsetup(_conditional_strings,"
+ str(len(header_data.conditionals))
+ ",_uniform_strings,"
+ str(len(header_data.uniforms))
+ ",_attribute_pairs,"
+ str(len(header_data.attributes))
+ ", _texunit_pairs,"
+ str(len(header_data.texunits))
+ ",_vertex_code,_fragment_code,_vertex_code_start,_fragment_code_start);\n"
)
else:
fd.write("\t\tsetup(_conditional_strings," + str(len(header_data.conditionals)) + ",_uniform_strings," + str(len(header_data.uniforms)) + ",_attribute_pairs," + str(
len(header_data.attributes)) + ", _texunit_pairs," + str(len(header_data.texunits)) + ",_ubo_pairs," + str(len(header_data.ubos)) + ",_feedbacks," + str(
feedback_count) + ",_vertex_code,_fragment_code,_vertex_code_start,_fragment_code_start);\n")
fd.write(
"\t\tsetup(_conditional_strings,"
+ str(len(header_data.conditionals))
+ ",_uniform_strings,"
+ str(len(header_data.uniforms))
+ ",_attribute_pairs,"
+ str(len(header_data.attributes))
+ ", _texunit_pairs,"
+ str(len(header_data.texunits))
+ ",_ubo_pairs,"
+ str(len(header_data.ubos))
+ ",_feedbacks,"
+ str(feedback_count)
+ ",_vertex_code,_fragment_code,_vertex_code_start,_fragment_code_start);\n"
)
else:
if gles2:
fd.write("\t\tsetup(_conditional_strings," + str(len(header_data.conditionals)) + ",_uniform_strings," + str(len(header_data.uniforms)) + ",_texunit_pairs," + str(
len(header_data.texunits)) + ",_enums," + str(len(header_data.enums)) + ",_enum_values," + str(
enum_value_count) + ",_vertex_code,_fragment_code,_vertex_code_start,_fragment_code_start);\n")
fd.write(
"\t\tsetup(_conditional_strings,"
+ str(len(header_data.conditionals))
+ ",_uniform_strings,"
+ str(len(header_data.uniforms))
+ ",_texunit_pairs,"
+ str(len(header_data.texunits))
+ ",_enums,"
+ str(len(header_data.enums))
+ ",_enum_values,"
+ str(enum_value_count)
+ ",_vertex_code,_fragment_code,_vertex_code_start,_fragment_code_start);\n"
)
else:
fd.write("\t\tsetup(_conditional_strings," + str(len(header_data.conditionals)) + ",_uniform_strings," + str(len(header_data.uniforms)) + ",_texunit_pairs," + str(
len(header_data.texunits)) + ",_enums," + str(len(header_data.enums)) + ",_enum_values," + str(enum_value_count) + ",_ubo_pairs," + str(len(header_data.ubos)) + ",_feedbacks," + str(
feedback_count) + ",_vertex_code,_fragment_code,_vertex_code_start,_fragment_code_start);\n")
fd.write(
"\t\tsetup(_conditional_strings,"
+ str(len(header_data.conditionals))
+ ",_uniform_strings,"
+ str(len(header_data.uniforms))
+ ",_texunit_pairs,"
+ str(len(header_data.texunits))
+ ",_enums,"
+ str(len(header_data.enums))
+ ",_enum_values,"
+ str(enum_value_count)
+ ",_ubo_pairs,"
+ str(len(header_data.ubos))
+ ",_feedbacks,"
+ str(feedback_count)
+ ",_vertex_code,_fragment_code,_vertex_code_start,_fragment_code_start);\n"
)
fd.write("\t}\n\n")
@@ -495,12 +585,12 @@ def build_legacygl_header(filename, include, class_suffix, output_attribs, gles2
def build_gles2_headers(target, source, env):
for x in source:
build_legacygl_header(str(x), include="drivers/gles2/shader_gles2.h", class_suffix="GLES2", output_attribs=True, gles2=True)
build_legacygl_header(
str(x), include="drivers/gles2/shader_gles2.h", class_suffix="GLES2", output_attribs=True, gles2=True
)
class RDHeaderStruct:
def __init__(self):
self.vertex_lines = []
self.fragment_lines = []
@@ -594,30 +684,30 @@ def build_rd_header(filename):
fd.write("/* WARNING, THIS FILE WAS GENERATED, DO NOT EDIT */\n")
out_file_base = out_file
out_file_base = out_file_base[out_file_base.rfind("/") + 1:]
out_file_base = out_file_base[out_file_base.rfind("\\") + 1:]
out_file_base = out_file_base[out_file_base.rfind("/") + 1 :]
out_file_base = out_file_base[out_file_base.rfind("\\") + 1 :]
out_file_ifdef = out_file_base.replace(".", "_").upper()
fd.write("#ifndef " + out_file_ifdef + "_RD\n")
fd.write("#define " + out_file_ifdef + "_RD\n")
out_file_class = out_file_base.replace(".glsl.gen.h", "").title().replace("_", "").replace(".", "") + "ShaderRD"
fd.write("\n")
fd.write("#include \"servers/rendering/rasterizer_rd/shader_rd.h\"\n\n")
fd.write('#include "servers/rendering/rasterizer_rd/shader_rd.h"\n\n')
fd.write("class " + out_file_class + " : public ShaderRD {\n\n")
fd.write("public:\n\n")
fd.write("\t" + out_file_class + "() {\n\n")
if (len(header_data.compute_lines)):
if len(header_data.compute_lines):
fd.write("\t\tstatic const char _compute_code[] = {\n")
for x in header_data.compute_lines:
for c in x:
fd.write(str(ord(c)) + ",")
fd.write(str(ord('\n')) + ",")
fd.write(str(ord("\n")) + ",")
fd.write("\t\t0};\n\n")
fd.write("\t\tsetup(nullptr, nullptr, _compute_code, \"" + out_file_class + "\");\n")
fd.write('\t\tsetup(nullptr, nullptr, _compute_code, "' + out_file_class + '");\n')
fd.write("\t}\n")
else:
@@ -626,17 +716,17 @@ def build_rd_header(filename):
for x in header_data.vertex_lines:
for c in x:
fd.write(str(ord(c)) + ",")
fd.write(str(ord('\n')) + ",")
fd.write(str(ord("\n")) + ",")
fd.write("\t\t0};\n\n")
fd.write("\t\tstatic const char _fragment_code[]={\n")
for x in header_data.fragment_lines:
for c in x:
fd.write(str(ord(c)) + ",")
fd.write(str(ord('\n')) + ",")
fd.write(str(ord("\n")) + ",")
fd.write("\t\t0};\n\n")
fd.write("\t\tsetup(_vertex_code, _fragment_code, nullptr, \"" + out_file_class + "\");\n")
fd.write('\t\tsetup(_vertex_code, _fragment_code, nullptr, "' + out_file_class + '");\n')
fd.write("\t}\n")
fd.write("};\n\n")
@@ -650,5 +740,5 @@ def build_rd_headers(target, source, env):
build_rd_header(str(x))
if __name__ == '__main__':
if __name__ == "__main__":
subprocess_main(globals())
+5 -3
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env python
Import('env')
Import("env")
from platform_methods import run_in_subprocess
import main_builders
@@ -14,13 +14,15 @@ env.Depends("#main/splash.gen.h", "#main/splash.png")
env.CommandNoCache("#main/splash.gen.h", "#main/splash.png", run_in_subprocess(main_builders.make_splash))
env.Depends("#main/splash_editor.gen.h", "#main/splash_editor.png")
env.CommandNoCache("#main/splash_editor.gen.h", "#main/splash_editor.png", run_in_subprocess(main_builders.make_splash_editor))
env.CommandNoCache(
"#main/splash_editor.gen.h", "#main/splash_editor.png", run_in_subprocess(main_builders.make_splash_editor)
)
env.Depends("#main/app_icon.gen.h", "#main/app_icon.png")
env.CommandNoCache("#main/app_icon.gen.h", "#main/app_icon.png", run_in_subprocess(main_builders.make_app_icon))
if env["tools"]:
SConscript('tests/SCsub')
SConscript("tests/SCsub")
lib = env.add_library("main", env.main_sources)
env.Prepend(LIBS=[lib])
+3 -3
View File
@@ -18,7 +18,7 @@ def make_splash(target, source, env):
g.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n")
g.write("#ifndef BOOT_SPLASH_H\n")
g.write("#define BOOT_SPLASH_H\n")
g.write('static const Color boot_splash_bg_color = Color(0.14, 0.14, 0.14);\n')
g.write("static const Color boot_splash_bg_color = Color(0.14, 0.14, 0.14);\n")
g.write("static const unsigned char boot_splash_png[] = {\n")
for i in range(len(buf)):
g.write(str(buf[i]) + ",\n")
@@ -37,7 +37,7 @@ def make_splash_editor(target, source, env):
g.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n")
g.write("#ifndef BOOT_SPLASH_EDITOR_H\n")
g.write("#define BOOT_SPLASH_EDITOR_H\n")
g.write('static const Color boot_splash_editor_bg_color = Color(0.14, 0.14, 0.14);\n')
g.write("static const Color boot_splash_editor_bg_color = Color(0.14, 0.14, 0.14);\n")
g.write("static const unsigned char boot_splash_editor_png[] = {\n")
for i in range(len(buf)):
g.write(str(buf[i]) + ",\n")
@@ -63,5 +63,5 @@ def make_app_icon(target, source, env):
g.write("#endif")
if __name__ == '__main__':
if __name__ == "__main__":
subprocess_main(globals())
+1 -1
View File
@@ -1,6 +1,6 @@
#!/usr/bin/python
Import('env')
Import("env")
env.tests_sources = []
env.add_source_files(env.tests_sources, "*.cpp")
+190 -129
View File
File diff suppressed because it is too large Load Diff
+12 -12
View File
@@ -37,24 +37,24 @@ files = open("files", "r")
fname = files.readline()
while (fname != ""):
while fname != "":
# Handle replacing $filename with actual filename and keep alignment
fsingle = fname.strip()
if (fsingle.find("/") != -1):
fsingle = fsingle[fsingle.rfind("/") + 1:]
if fsingle.find("/") != -1:
fsingle = fsingle[fsingle.rfind("/") + 1 :]
rep_fl = "$filename"
rep_fi = fsingle
len_fl = len(rep_fl)
len_fi = len(rep_fi)
# Pad with spaces to keep alignment
if (len_fi < len_fl):
if len_fi < len_fl:
for x in range(len_fl - len_fi):
rep_fi += " "
elif (len_fl < len_fi):
elif len_fl < len_fi:
for x in range(len_fi - len_fl):
rep_fl += " "
if (header.find(rep_fl) != -1):
if header.find(rep_fl) != -1:
text = header.replace(rep_fl, rep_fi)
else:
text = header.replace("$filename", fsingle)
@@ -71,21 +71,21 @@ while (fname != ""):
line = fileread.readline()
header_done = False
while (line.strip() == ""): # Skip empty lines at the top
while line.strip() == "": # Skip empty lines at the top
line = fileread.readline()
if (line.find("/**********") == -1): # Godot header starts this way
if line.find("/**********") == -1: # Godot header starts this way
# Maybe starting with a non-Godot comment, abort header magic
header_done = True
while (not header_done): # Handle header now
if (line.find("/*") != 0): # No more starting with a comment
while not header_done: # Handle header now
if line.find("/*") != 0: # No more starting with a comment
header_done = True
if (line.strip() != ""):
if line.strip() != "":
text += line
line = fileread.readline()
while (line != ""): # Dump everything until EOF
while line != "": # Dump everything until EOF
text += line
line = fileread.readline()
+2 -2
View File
@@ -1,12 +1,12 @@
#!/usr/bin/env python
Import('env')
Import("env")
import modules_builders
env_modules = env.Clone()
Export('env_modules')
Export("env_modules")
# Header with MODULE_*_ENABLED defines.
env.CommandNoCache("modules_enabled.gen.h", Value(env.module_list), modules_builders.generate_modules_enabled)
+3 -3
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
Import('env')
Import('env_modules')
Import("env")
Import("env_modules")
env_arkit = env_modules.Clone()
@@ -9,4 +9,4 @@ env_arkit = env_modules.Clone()
modules_sources = []
env_arkit.add_source_files(modules_sources, "*.cpp")
env_arkit.add_source_files(modules_sources, "*.mm")
mod_lib = env_modules.add_library('#bin/libgodot_arkit_module' + env['LIBSUFFIX'], modules_sources)
mod_lib = env_modules.add_library("#bin/libgodot_arkit_module" + env["LIBSUFFIX"], modules_sources)
+2 -1
View File
@@ -1,5 +1,6 @@
def can_build(env, platform):
return platform == 'iphone'
return platform == "iphone"
def configure(env):
pass
+75 -75
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
Import('env')
Import('env_modules')
Import("env")
Import("env_modules")
env_assimp = env_modules.Clone()
@@ -10,85 +10,85 @@ env_assimp = env_modules.Clone()
if True: # env['builtin_assimp']:
thirdparty_dir = "#thirdparty/assimp"
env_assimp.Prepend(CPPPATH=['#thirdparty/assimp'])
env_assimp.Prepend(CPPPATH=['#thirdparty/assimp/code'])
env_assimp.Prepend(CPPPATH=['#thirdparty/assimp/include'])
env_assimp.Prepend(CPPPATH=["#thirdparty/assimp"])
env_assimp.Prepend(CPPPATH=["#thirdparty/assimp/code"])
env_assimp.Prepend(CPPPATH=["#thirdparty/assimp/include"])
#env_assimp.Append(CPPDEFINES=['ASSIMP_DOUBLE_PRECISION']) # TODO default to what godot is compiled with for future double support
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_SINGLETHREADED'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_BOOST_WORKAROUND'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_OWN_ZLIB'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_EXPORT'])
# env_assimp.Append(CPPDEFINES=['ASSIMP_DOUBLE_PRECISION']) # TODO default to what godot is compiled with for future double support
env_assimp.Append(CPPDEFINES=["ASSIMP_BUILD_SINGLETHREADED"])
env_assimp.Append(CPPDEFINES=["ASSIMP_BUILD_BOOST_WORKAROUND"])
env_assimp.Append(CPPDEFINES=["ASSIMP_BUILD_NO_OWN_ZLIB"])
env_assimp.Append(CPPDEFINES=["ASSIMP_BUILD_NO_EXPORT"])
# Importers we don't need
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_3D_IMPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_3DS_IMPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_3MF_IMPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_AC_IMPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_AMF_IMPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_ASE_IMPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_ASSBIN_IMPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_B3D_IMPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_BLEND_IMPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_BVH_IMPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_C4D_IMPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_COB_IMPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_COLLADA_IMPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_CSM_IMPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_DXF_IMPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_GLTF2_IMPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_GLTF_IMPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_HMP_IMPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_IFC_IMPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_IRR_IMPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_IRRMESH_IMPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_LWO_IMPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_LWS_IMPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_M3D_IMPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_MD2_IMPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_MD3_IMPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_MD5_IMPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_MD5_IMPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_MDC_IMPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_MDL_IMPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_MMD_IMPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_MS3D_IMPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_NDO_IMPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_NFF_IMPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_OBJ_IMPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_OFF_IMPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_OGRE_IMPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_OPENGEX_IMPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_PLY_IMPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_Q3BSP_IMPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_Q3D_IMPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_RAW_IMPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_SIB_IMPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_SMD_IMPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_STEP_IMPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_STL_IMPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_TERRAGEN_IMPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_X3D_IMPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_XGL_IMPORTER'])
env_assimp.Append(CPPDEFINES=['ASSIMP_BUILD_NO_X_IMPORTER'])
env_assimp.Append(CPPDEFINES=["ASSIMP_BUILD_NO_3D_IMPORTER"])
env_assimp.Append(CPPDEFINES=["ASSIMP_BUILD_NO_3DS_IMPORTER"])
env_assimp.Append(CPPDEFINES=["ASSIMP_BUILD_NO_3MF_IMPORTER"])
env_assimp.Append(CPPDEFINES=["ASSIMP_BUILD_NO_AC_IMPORTER"])
env_assimp.Append(CPPDEFINES=["ASSIMP_BUILD_NO_AMF_IMPORTER"])
env_assimp.Append(CPPDEFINES=["ASSIMP_BUILD_NO_ASE_IMPORTER"])
env_assimp.Append(CPPDEFINES=["ASSIMP_BUILD_NO_ASSBIN_IMPORTER"])
env_assimp.Append(CPPDEFINES=["ASSIMP_BUILD_NO_B3D_IMPORTER"])
env_assimp.Append(CPPDEFINES=["ASSIMP_BUILD_NO_BLEND_IMPORTER"])
env_assimp.Append(CPPDEFINES=["ASSIMP_BUILD_NO_BVH_IMPORTER"])
env_assimp.Append(CPPDEFINES=["ASSIMP_BUILD_NO_C4D_IMPORTER"])
env_assimp.Append(CPPDEFINES=["ASSIMP_BUILD_NO_COB_IMPORTER"])
env_assimp.Append(CPPDEFINES=["ASSIMP_BUILD_NO_COLLADA_IMPORTER"])
env_assimp.Append(CPPDEFINES=["ASSIMP_BUILD_NO_CSM_IMPORTER"])
env_assimp.Append(CPPDEFINES=["ASSIMP_BUILD_NO_DXF_IMPORTER"])
env_assimp.Append(CPPDEFINES=["ASSIMP_BUILD_NO_GLTF2_IMPORTER"])
env_assimp.Append(CPPDEFINES=["ASSIMP_BUILD_NO_GLTF_IMPORTER"])
env_assimp.Append(CPPDEFINES=["ASSIMP_BUILD_NO_HMP_IMPORTER"])
env_assimp.Append(CPPDEFINES=["ASSIMP_BUILD_NO_IFC_IMPORTER"])
env_assimp.Append(CPPDEFINES=["ASSIMP_BUILD_NO_IRR_IMPORTER"])
env_assimp.Append(CPPDEFINES=["ASSIMP_BUILD_NO_IRRMESH_IMPORTER"])
env_assimp.Append(CPPDEFINES=["ASSIMP_BUILD_NO_LWO_IMPORTER"])
env_assimp.Append(CPPDEFINES=["ASSIMP_BUILD_NO_LWS_IMPORTER"])
env_assimp.Append(CPPDEFINES=["ASSIMP_BUILD_NO_M3D_IMPORTER"])
env_assimp.Append(CPPDEFINES=["ASSIMP_BUILD_NO_MD2_IMPORTER"])
env_assimp.Append(CPPDEFINES=["ASSIMP_BUILD_NO_MD3_IMPORTER"])
env_assimp.Append(CPPDEFINES=["ASSIMP_BUILD_NO_MD5_IMPORTER"])
env_assimp.Append(CPPDEFINES=["ASSIMP_BUILD_NO_MD5_IMPORTER"])
env_assimp.Append(CPPDEFINES=["ASSIMP_BUILD_NO_MDC_IMPORTER"])
env_assimp.Append(CPPDEFINES=["ASSIMP_BUILD_NO_MDL_IMPORTER"])
env_assimp.Append(CPPDEFINES=["ASSIMP_BUILD_NO_MMD_IMPORTER"])
env_assimp.Append(CPPDEFINES=["ASSIMP_BUILD_NO_MS3D_IMPORTER"])
env_assimp.Append(CPPDEFINES=["ASSIMP_BUILD_NO_NDO_IMPORTER"])
env_assimp.Append(CPPDEFINES=["ASSIMP_BUILD_NO_NFF_IMPORTER"])
env_assimp.Append(CPPDEFINES=["ASSIMP_BUILD_NO_OBJ_IMPORTER"])
env_assimp.Append(CPPDEFINES=["ASSIMP_BUILD_NO_OFF_IMPORTER"])
env_assimp.Append(CPPDEFINES=["ASSIMP_BUILD_NO_OGRE_IMPORTER"])
env_assimp.Append(CPPDEFINES=["ASSIMP_BUILD_NO_OPENGEX_IMPORTER"])
env_assimp.Append(CPPDEFINES=["ASSIMP_BUILD_NO_PLY_IMPORTER"])
env_assimp.Append(CPPDEFINES=["ASSIMP_BUILD_NO_Q3BSP_IMPORTER"])
env_assimp.Append(CPPDEFINES=["ASSIMP_BUILD_NO_Q3D_IMPORTER"])
env_assimp.Append(CPPDEFINES=["ASSIMP_BUILD_NO_RAW_IMPORTER"])
env_assimp.Append(CPPDEFINES=["ASSIMP_BUILD_NO_SIB_IMPORTER"])
env_assimp.Append(CPPDEFINES=["ASSIMP_BUILD_NO_SMD_IMPORTER"])
env_assimp.Append(CPPDEFINES=["ASSIMP_BUILD_NO_STEP_IMPORTER"])
env_assimp.Append(CPPDEFINES=["ASSIMP_BUILD_NO_STL_IMPORTER"])
env_assimp.Append(CPPDEFINES=["ASSIMP_BUILD_NO_TERRAGEN_IMPORTER"])
env_assimp.Append(CPPDEFINES=["ASSIMP_BUILD_NO_X3D_IMPORTER"])
env_assimp.Append(CPPDEFINES=["ASSIMP_BUILD_NO_XGL_IMPORTER"])
env_assimp.Append(CPPDEFINES=["ASSIMP_BUILD_NO_X_IMPORTER"])
if env["platform"] == "windows":
env_assimp.Append(CPPDEFINES=["PLATFORM_WINDOWS"])
env_assimp.Append(CPPDEFINES=[("PLATFORM", "WINDOWS")])
elif env["platform"] == "linuxbsd":
env_assimp.Append(CPPDEFINES=["PLATFORM_LINUX"])
env_assimp.Append(CPPDEFINES=[("PLATFORM", "LINUX")])
elif env["platform"] == "osx":
env_assimp.Append(CPPDEFINES=["PLATFORM_DARWIN"])
env_assimp.Append(CPPDEFINES=[("PLATFORM", "DARWIN")])
if(env['platform'] == 'windows'):
env_assimp.Append(CPPDEFINES=['PLATFORM_WINDOWS'])
env_assimp.Append(CPPDEFINES=[('PLATFORM', 'WINDOWS')])
elif(env['platform'] == 'linuxbsd'):
env_assimp.Append(CPPDEFINES=['PLATFORM_LINUX'])
env_assimp.Append(CPPDEFINES=[('PLATFORM', 'LINUX')])
elif(env['platform'] == 'osx'):
env_assimp.Append(CPPDEFINES=['PLATFORM_DARWIN'])
env_assimp.Append(CPPDEFINES=[('PLATFORM', 'DARWIN')])
env_thirdparty = env_assimp.Clone()
env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(env.modules_sources, Glob('#thirdparty/assimp/code/CApi/*.cpp'))
env_thirdparty.add_source_files(env.modules_sources, Glob('#thirdparty/assimp/code/Common/*.cpp'))
env_thirdparty.add_source_files(env.modules_sources, Glob('#thirdparty/assimp/code/PostProcessing/*.cpp'))
env_thirdparty.add_source_files(env.modules_sources, Glob('#thirdparty/assimp/code/Material/*.cpp'))
env_thirdparty.add_source_files(env.modules_sources, Glob('#thirdparty/assimp/code/FBX/*.cpp'))
env_thirdparty.add_source_files(env.modules_sources, Glob("#thirdparty/assimp/code/CApi/*.cpp"))
env_thirdparty.add_source_files(env.modules_sources, Glob("#thirdparty/assimp/code/Common/*.cpp"))
env_thirdparty.add_source_files(env.modules_sources, Glob("#thirdparty/assimp/code/PostProcessing/*.cpp"))
env_thirdparty.add_source_files(env.modules_sources, Glob("#thirdparty/assimp/code/Material/*.cpp"))
env_thirdparty.add_source_files(env.modules_sources, Glob("#thirdparty/assimp/code/FBX/*.cpp"))
# Godot's own source files
env_assimp.add_source_files(env.modules_sources, "*.cpp")
+2 -1
View File
@@ -1,5 +1,6 @@
def can_build(env, platform):
return env['tools']
return env["tools"]
def configure(env):
pass
+22 -20
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
Import('env')
Import('env_modules')
Import("env")
Import("env_modules")
env_basisu = env_modules.Clone()
@@ -9,36 +9,38 @@ env_basisu = env_modules.Clone()
# Not unbundled so far since not widespread as shared library
thirdparty_dir = "#thirdparty/basis_universal/"
tool_sources = [
"basisu_astc_decomp.cpp",
"basisu_backend.cpp",
"basisu_basis_file.cpp",
"basisu_comp.cpp",
"basisu_enc.cpp",
"basisu_etc.cpp",
"basisu_frontend.cpp",
"basisu_global_selector_palette_helpers.cpp",
"basisu_gpu_texture.cpp",
"basisu_pvrtc1_4.cpp",
"basisu_resample_filters.cpp",
"basisu_resampler.cpp",
"basisu_ssim.cpp",
"lodepng.cpp",
"basisu_astc_decomp.cpp",
"basisu_backend.cpp",
"basisu_basis_file.cpp",
"basisu_comp.cpp",
"basisu_enc.cpp",
"basisu_etc.cpp",
"basisu_frontend.cpp",
"basisu_global_selector_palette_helpers.cpp",
"basisu_gpu_texture.cpp",
"basisu_pvrtc1_4.cpp",
"basisu_resample_filters.cpp",
"basisu_resampler.cpp",
"basisu_ssim.cpp",
"lodepng.cpp",
]
tool_sources = [thirdparty_dir + file for file in tool_sources]
transcoder_sources = [thirdparty_dir + "transcoder/basisu_transcoder.cpp"]
# Treat Basis headers as system headers to avoid raising warnings. Not supported on MSVC.
if not env.msvc:
env_basisu.Append(CPPFLAGS=['-isystem', Dir(thirdparty_dir).path, '-isystem', Dir(thirdparty_dir + "transcoder").path])
env_basisu.Append(
CPPFLAGS=["-isystem", Dir(thirdparty_dir).path, "-isystem", Dir(thirdparty_dir + "transcoder").path]
)
else:
env_basisu.Prepend(CPPPATH=[thirdparty_dir, thirdparty_dir + "transcoder"])
if env['target'] == "debug":
env_basisu.Append(CPPFLAGS=["-DBASISU_DEVEL_MESSAGES=1", "-DBASISD_ENABLE_DEBUG_FLAGS=1"])
if env["target"] == "debug":
env_basisu.Append(CPPFLAGS=["-DBASISU_DEVEL_MESSAGES=1", "-DBASISD_ENABLE_DEBUG_FLAGS=1"])
env_thirdparty = env_basisu.Clone()
env_thirdparty.disable_warnings()
if env['tools']:
if env["tools"]:
env_thirdparty.add_source_files(env.modules_sources, tool_sources)
env_thirdparty.add_source_files(env.modules_sources, transcoder_sources)
+1
View File
@@ -1,5 +1,6 @@
def can_build(env, platform):
return True
def configure(env):
pass
+2 -2
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
Import('env')
Import('env_modules')
Import("env")
Import("env_modules")
env_bmp = env_modules.Clone()
+1
View File
@@ -1,5 +1,6 @@
def can_build(env, platform):
return True
def configure(env):
pass
+176 -181
View File
@@ -1,208 +1,203 @@
#!/usr/bin/env python
Import('env')
Import('env_modules')
Import("env")
Import("env_modules")
env_bullet = env_modules.Clone()
# Thirdparty source files
if env['builtin_bullet']:
if env["builtin_bullet"]:
# Build only version 2 for now (as of 2.89)
# Sync file list with relevant upstream CMakeLists.txt for each folder.
thirdparty_dir = "#thirdparty/bullet/"
bullet2_src = [
# BulletCollision
"BulletCollision/BroadphaseCollision/btAxisSweep3.cpp"
, "BulletCollision/BroadphaseCollision/btBroadphaseProxy.cpp"
, "BulletCollision/BroadphaseCollision/btCollisionAlgorithm.cpp"
, "BulletCollision/BroadphaseCollision/btDbvt.cpp"
, "BulletCollision/BroadphaseCollision/btDbvtBroadphase.cpp"
, "BulletCollision/BroadphaseCollision/btDispatcher.cpp"
, "BulletCollision/BroadphaseCollision/btOverlappingPairCache.cpp"
, "BulletCollision/BroadphaseCollision/btQuantizedBvh.cpp"
, "BulletCollision/BroadphaseCollision/btSimpleBroadphase.cpp"
, "BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.cpp"
, "BulletCollision/CollisionDispatch/btBoxBoxCollisionAlgorithm.cpp"
, "BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.cpp"
, "BulletCollision/CollisionDispatch/btBoxBoxDetector.cpp"
, "BulletCollision/CollisionDispatch/btCollisionDispatcher.cpp"
, "BulletCollision/CollisionDispatch/btCollisionDispatcherMt.cpp"
, "BulletCollision/CollisionDispatch/btCollisionObject.cpp"
, "BulletCollision/CollisionDispatch/btCollisionWorld.cpp"
, "BulletCollision/CollisionDispatch/btCollisionWorldImporter.cpp"
, "BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp"
, "BulletCollision/CollisionDispatch/btCompoundCompoundCollisionAlgorithm.cpp"
, "BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.cpp"
, "BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp"
, "BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.cpp"
, "BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.cpp"
, "BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.cpp"
, "BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.cpp"
, "BulletCollision/CollisionDispatch/btGhostObject.cpp"
, "BulletCollision/CollisionDispatch/btHashedSimplePairCache.cpp"
, "BulletCollision/CollisionDispatch/btInternalEdgeUtility.cpp"
, "BulletCollision/CollisionDispatch/btManifoldResult.cpp"
, "BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp"
, "BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.cpp"
, "BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.cpp"
, "BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.cpp"
, "BulletCollision/CollisionDispatch/btUnionFind.cpp"
, "BulletCollision/CollisionDispatch/SphereTriangleDetector.cpp"
, "BulletCollision/CollisionShapes/btBoxShape.cpp"
, "BulletCollision/CollisionShapes/btBox2dShape.cpp"
, "BulletCollision/CollisionShapes/btBvhTriangleMeshShape.cpp"
, "BulletCollision/CollisionShapes/btCapsuleShape.cpp"
, "BulletCollision/CollisionShapes/btCollisionShape.cpp"
, "BulletCollision/CollisionShapes/btCompoundShape.cpp"
, "BulletCollision/CollisionShapes/btConcaveShape.cpp"
, "BulletCollision/CollisionShapes/btConeShape.cpp"
, "BulletCollision/CollisionShapes/btConvexHullShape.cpp"
, "BulletCollision/CollisionShapes/btConvexInternalShape.cpp"
, "BulletCollision/CollisionShapes/btConvexPointCloudShape.cpp"
, "BulletCollision/CollisionShapes/btConvexPolyhedron.cpp"
, "BulletCollision/CollisionShapes/btConvexShape.cpp"
, "BulletCollision/CollisionShapes/btConvex2dShape.cpp"
, "BulletCollision/CollisionShapes/btConvexTriangleMeshShape.cpp"
, "BulletCollision/CollisionShapes/btCylinderShape.cpp"
, "BulletCollision/CollisionShapes/btEmptyShape.cpp"
, "BulletCollision/CollisionShapes/btHeightfieldTerrainShape.cpp"
, "BulletCollision/CollisionShapes/btMiniSDF.cpp"
, "BulletCollision/CollisionShapes/btMinkowskiSumShape.cpp"
, "BulletCollision/CollisionShapes/btMultimaterialTriangleMeshShape.cpp"
, "BulletCollision/CollisionShapes/btMultiSphereShape.cpp"
, "BulletCollision/CollisionShapes/btOptimizedBvh.cpp"
, "BulletCollision/CollisionShapes/btPolyhedralConvexShape.cpp"
, "BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.cpp"
, "BulletCollision/CollisionShapes/btSdfCollisionShape.cpp"
, "BulletCollision/CollisionShapes/btShapeHull.cpp"
, "BulletCollision/CollisionShapes/btSphereShape.cpp"
, "BulletCollision/CollisionShapes/btStaticPlaneShape.cpp"
, "BulletCollision/CollisionShapes/btStridingMeshInterface.cpp"
, "BulletCollision/CollisionShapes/btTetrahedronShape.cpp"
, "BulletCollision/CollisionShapes/btTriangleBuffer.cpp"
, "BulletCollision/CollisionShapes/btTriangleCallback.cpp"
, "BulletCollision/CollisionShapes/btTriangleIndexVertexArray.cpp"
, "BulletCollision/CollisionShapes/btTriangleIndexVertexMaterialArray.cpp"
, "BulletCollision/CollisionShapes/btTriangleMesh.cpp"
, "BulletCollision/CollisionShapes/btTriangleMeshShape.cpp"
, "BulletCollision/CollisionShapes/btUniformScalingShape.cpp"
, "BulletCollision/Gimpact/btContactProcessing.cpp"
, "BulletCollision/Gimpact/btGenericPoolAllocator.cpp"
, "BulletCollision/Gimpact/btGImpactBvh.cpp"
, "BulletCollision/Gimpact/btGImpactCollisionAlgorithm.cpp"
, "BulletCollision/Gimpact/btGImpactQuantizedBvh.cpp"
, "BulletCollision/Gimpact/btGImpactShape.cpp"
, "BulletCollision/Gimpact/btTriangleShapeEx.cpp"
, "BulletCollision/Gimpact/gim_box_set.cpp"
, "BulletCollision/Gimpact/gim_contact.cpp"
, "BulletCollision/Gimpact/gim_memory.cpp"
, "BulletCollision/Gimpact/gim_tri_collision.cpp"
, "BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.cpp"
, "BulletCollision/NarrowPhaseCollision/btConvexCast.cpp"
, "BulletCollision/NarrowPhaseCollision/btGjkConvexCast.cpp"
, "BulletCollision/NarrowPhaseCollision/btGjkEpa2.cpp"
, "BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.cpp"
, "BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp"
, "BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.cpp"
, "BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp"
, "BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp"
, "BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.cpp"
, "BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.cpp"
, "BulletCollision/NarrowPhaseCollision/btPolyhedralContactClipping.cpp"
"BulletCollision/BroadphaseCollision/btAxisSweep3.cpp",
"BulletCollision/BroadphaseCollision/btBroadphaseProxy.cpp",
"BulletCollision/BroadphaseCollision/btCollisionAlgorithm.cpp",
"BulletCollision/BroadphaseCollision/btDbvt.cpp",
"BulletCollision/BroadphaseCollision/btDbvtBroadphase.cpp",
"BulletCollision/BroadphaseCollision/btDispatcher.cpp",
"BulletCollision/BroadphaseCollision/btOverlappingPairCache.cpp",
"BulletCollision/BroadphaseCollision/btQuantizedBvh.cpp",
"BulletCollision/BroadphaseCollision/btSimpleBroadphase.cpp",
"BulletCollision/CollisionDispatch/btActivatingCollisionAlgorithm.cpp",
"BulletCollision/CollisionDispatch/btBoxBoxCollisionAlgorithm.cpp",
"BulletCollision/CollisionDispatch/btBox2dBox2dCollisionAlgorithm.cpp",
"BulletCollision/CollisionDispatch/btBoxBoxDetector.cpp",
"BulletCollision/CollisionDispatch/btCollisionDispatcher.cpp",
"BulletCollision/CollisionDispatch/btCollisionDispatcherMt.cpp",
"BulletCollision/CollisionDispatch/btCollisionObject.cpp",
"BulletCollision/CollisionDispatch/btCollisionWorld.cpp",
"BulletCollision/CollisionDispatch/btCollisionWorldImporter.cpp",
"BulletCollision/CollisionDispatch/btCompoundCollisionAlgorithm.cpp",
"BulletCollision/CollisionDispatch/btCompoundCompoundCollisionAlgorithm.cpp",
"BulletCollision/CollisionDispatch/btConvexConcaveCollisionAlgorithm.cpp",
"BulletCollision/CollisionDispatch/btConvexConvexAlgorithm.cpp",
"BulletCollision/CollisionDispatch/btConvexPlaneCollisionAlgorithm.cpp",
"BulletCollision/CollisionDispatch/btConvex2dConvex2dAlgorithm.cpp",
"BulletCollision/CollisionDispatch/btDefaultCollisionConfiguration.cpp",
"BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.cpp",
"BulletCollision/CollisionDispatch/btGhostObject.cpp",
"BulletCollision/CollisionDispatch/btHashedSimplePairCache.cpp",
"BulletCollision/CollisionDispatch/btInternalEdgeUtility.cpp",
"BulletCollision/CollisionDispatch/btManifoldResult.cpp",
"BulletCollision/CollisionDispatch/btSimulationIslandManager.cpp",
"BulletCollision/CollisionDispatch/btSphereBoxCollisionAlgorithm.cpp",
"BulletCollision/CollisionDispatch/btSphereSphereCollisionAlgorithm.cpp",
"BulletCollision/CollisionDispatch/btSphereTriangleCollisionAlgorithm.cpp",
"BulletCollision/CollisionDispatch/btUnionFind.cpp",
"BulletCollision/CollisionDispatch/SphereTriangleDetector.cpp",
"BulletCollision/CollisionShapes/btBoxShape.cpp",
"BulletCollision/CollisionShapes/btBox2dShape.cpp",
"BulletCollision/CollisionShapes/btBvhTriangleMeshShape.cpp",
"BulletCollision/CollisionShapes/btCapsuleShape.cpp",
"BulletCollision/CollisionShapes/btCollisionShape.cpp",
"BulletCollision/CollisionShapes/btCompoundShape.cpp",
"BulletCollision/CollisionShapes/btConcaveShape.cpp",
"BulletCollision/CollisionShapes/btConeShape.cpp",
"BulletCollision/CollisionShapes/btConvexHullShape.cpp",
"BulletCollision/CollisionShapes/btConvexInternalShape.cpp",
"BulletCollision/CollisionShapes/btConvexPointCloudShape.cpp",
"BulletCollision/CollisionShapes/btConvexPolyhedron.cpp",
"BulletCollision/CollisionShapes/btConvexShape.cpp",
"BulletCollision/CollisionShapes/btConvex2dShape.cpp",
"BulletCollision/CollisionShapes/btConvexTriangleMeshShape.cpp",
"BulletCollision/CollisionShapes/btCylinderShape.cpp",
"BulletCollision/CollisionShapes/btEmptyShape.cpp",
"BulletCollision/CollisionShapes/btHeightfieldTerrainShape.cpp",
"BulletCollision/CollisionShapes/btMiniSDF.cpp",
"BulletCollision/CollisionShapes/btMinkowskiSumShape.cpp",
"BulletCollision/CollisionShapes/btMultimaterialTriangleMeshShape.cpp",
"BulletCollision/CollisionShapes/btMultiSphereShape.cpp",
"BulletCollision/CollisionShapes/btOptimizedBvh.cpp",
"BulletCollision/CollisionShapes/btPolyhedralConvexShape.cpp",
"BulletCollision/CollisionShapes/btScaledBvhTriangleMeshShape.cpp",
"BulletCollision/CollisionShapes/btSdfCollisionShape.cpp",
"BulletCollision/CollisionShapes/btShapeHull.cpp",
"BulletCollision/CollisionShapes/btSphereShape.cpp",
"BulletCollision/CollisionShapes/btStaticPlaneShape.cpp",
"BulletCollision/CollisionShapes/btStridingMeshInterface.cpp",
"BulletCollision/CollisionShapes/btTetrahedronShape.cpp",
"BulletCollision/CollisionShapes/btTriangleBuffer.cpp",
"BulletCollision/CollisionShapes/btTriangleCallback.cpp",
"BulletCollision/CollisionShapes/btTriangleIndexVertexArray.cpp",
"BulletCollision/CollisionShapes/btTriangleIndexVertexMaterialArray.cpp",
"BulletCollision/CollisionShapes/btTriangleMesh.cpp",
"BulletCollision/CollisionShapes/btTriangleMeshShape.cpp",
"BulletCollision/CollisionShapes/btUniformScalingShape.cpp",
"BulletCollision/Gimpact/btContactProcessing.cpp",
"BulletCollision/Gimpact/btGenericPoolAllocator.cpp",
"BulletCollision/Gimpact/btGImpactBvh.cpp",
"BulletCollision/Gimpact/btGImpactCollisionAlgorithm.cpp",
"BulletCollision/Gimpact/btGImpactQuantizedBvh.cpp",
"BulletCollision/Gimpact/btGImpactShape.cpp",
"BulletCollision/Gimpact/btTriangleShapeEx.cpp",
"BulletCollision/Gimpact/gim_box_set.cpp",
"BulletCollision/Gimpact/gim_contact.cpp",
"BulletCollision/Gimpact/gim_memory.cpp",
"BulletCollision/Gimpact/gim_tri_collision.cpp",
"BulletCollision/NarrowPhaseCollision/btContinuousConvexCollision.cpp",
"BulletCollision/NarrowPhaseCollision/btConvexCast.cpp",
"BulletCollision/NarrowPhaseCollision/btGjkConvexCast.cpp",
"BulletCollision/NarrowPhaseCollision/btGjkEpa2.cpp",
"BulletCollision/NarrowPhaseCollision/btGjkEpaPenetrationDepthSolver.cpp",
"BulletCollision/NarrowPhaseCollision/btGjkPairDetector.cpp",
"BulletCollision/NarrowPhaseCollision/btMinkowskiPenetrationDepthSolver.cpp",
"BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp",
"BulletCollision/NarrowPhaseCollision/btRaycastCallback.cpp",
"BulletCollision/NarrowPhaseCollision/btSubSimplexConvexCast.cpp",
"BulletCollision/NarrowPhaseCollision/btVoronoiSimplexSolver.cpp",
"BulletCollision/NarrowPhaseCollision/btPolyhedralContactClipping.cpp",
# BulletDynamics
, "BulletDynamics/Character/btKinematicCharacterController.cpp"
, "BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp"
, "BulletDynamics/ConstraintSolver/btContactConstraint.cpp"
, "BulletDynamics/ConstraintSolver/btFixedConstraint.cpp"
, "BulletDynamics/ConstraintSolver/btGearConstraint.cpp"
, "BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.cpp"
, "BulletDynamics/ConstraintSolver/btGeneric6DofSpringConstraint.cpp"
, "BulletDynamics/ConstraintSolver/btGeneric6DofSpring2Constraint.cpp"
, "BulletDynamics/ConstraintSolver/btHinge2Constraint.cpp"
, "BulletDynamics/ConstraintSolver/btHingeConstraint.cpp"
, "BulletDynamics/ConstraintSolver/btPoint2PointConstraint.cpp"
, "BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp"
, "BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolverMt.cpp"
, "BulletDynamics/ConstraintSolver/btBatchedConstraints.cpp"
, "BulletDynamics/ConstraintSolver/btNNCGConstraintSolver.cpp"
, "BulletDynamics/ConstraintSolver/btSliderConstraint.cpp"
, "BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.cpp"
, "BulletDynamics/ConstraintSolver/btTypedConstraint.cpp"
, "BulletDynamics/ConstraintSolver/btUniversalConstraint.cpp"
, "BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp"
, "BulletDynamics/Dynamics/btDiscreteDynamicsWorldMt.cpp"
, "BulletDynamics/Dynamics/btSimulationIslandManagerMt.cpp"
, "BulletDynamics/Dynamics/btRigidBody.cpp"
, "BulletDynamics/Dynamics/btSimpleDynamicsWorld.cpp"
#, "BulletDynamics/Dynamics/Bullet-C-API.cpp"
, "BulletDynamics/Vehicle/btRaycastVehicle.cpp"
, "BulletDynamics/Vehicle/btWheelInfo.cpp"
, "BulletDynamics/Featherstone/btMultiBody.cpp"
, "BulletDynamics/Featherstone/btMultiBodyConstraint.cpp"
, "BulletDynamics/Featherstone/btMultiBodyConstraintSolver.cpp"
, "BulletDynamics/Featherstone/btMultiBodyDynamicsWorld.cpp"
, "BulletDynamics/Featherstone/btMultiBodyFixedConstraint.cpp"
, "BulletDynamics/Featherstone/btMultiBodyGearConstraint.cpp"
, "BulletDynamics/Featherstone/btMultiBodyJointLimitConstraint.cpp"
, "BulletDynamics/Featherstone/btMultiBodyJointMotor.cpp"
, "BulletDynamics/Featherstone/btMultiBodyMLCPConstraintSolver.cpp"
, "BulletDynamics/Featherstone/btMultiBodyPoint2Point.cpp"
, "BulletDynamics/Featherstone/btMultiBodySliderConstraint.cpp"
, "BulletDynamics/Featherstone/btMultiBodySphericalJointMotor.cpp"
, "BulletDynamics/MLCPSolvers/btDantzigLCP.cpp"
, "BulletDynamics/MLCPSolvers/btMLCPSolver.cpp"
, "BulletDynamics/MLCPSolvers/btLemkeAlgorithm.cpp"
"BulletDynamics/Character/btKinematicCharacterController.cpp",
"BulletDynamics/ConstraintSolver/btConeTwistConstraint.cpp",
"BulletDynamics/ConstraintSolver/btContactConstraint.cpp",
"BulletDynamics/ConstraintSolver/btFixedConstraint.cpp",
"BulletDynamics/ConstraintSolver/btGearConstraint.cpp",
"BulletDynamics/ConstraintSolver/btGeneric6DofConstraint.cpp",
"BulletDynamics/ConstraintSolver/btGeneric6DofSpringConstraint.cpp",
"BulletDynamics/ConstraintSolver/btGeneric6DofSpring2Constraint.cpp",
"BulletDynamics/ConstraintSolver/btHinge2Constraint.cpp",
"BulletDynamics/ConstraintSolver/btHingeConstraint.cpp",
"BulletDynamics/ConstraintSolver/btPoint2PointConstraint.cpp",
"BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolver.cpp",
"BulletDynamics/ConstraintSolver/btSequentialImpulseConstraintSolverMt.cpp",
"BulletDynamics/ConstraintSolver/btBatchedConstraints.cpp",
"BulletDynamics/ConstraintSolver/btNNCGConstraintSolver.cpp",
"BulletDynamics/ConstraintSolver/btSliderConstraint.cpp",
"BulletDynamics/ConstraintSolver/btSolve2LinearConstraint.cpp",
"BulletDynamics/ConstraintSolver/btTypedConstraint.cpp",
"BulletDynamics/ConstraintSolver/btUniversalConstraint.cpp",
"BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp",
"BulletDynamics/Dynamics/btDiscreteDynamicsWorldMt.cpp",
"BulletDynamics/Dynamics/btSimulationIslandManagerMt.cpp",
"BulletDynamics/Dynamics/btRigidBody.cpp",
"BulletDynamics/Dynamics/btSimpleDynamicsWorld.cpp",
# "BulletDynamics/Dynamics/Bullet-C-API.cpp",
"BulletDynamics/Vehicle/btRaycastVehicle.cpp",
"BulletDynamics/Vehicle/btWheelInfo.cpp",
"BulletDynamics/Featherstone/btMultiBody.cpp",
"BulletDynamics/Featherstone/btMultiBodyConstraint.cpp",
"BulletDynamics/Featherstone/btMultiBodyConstraintSolver.cpp",
"BulletDynamics/Featherstone/btMultiBodyDynamicsWorld.cpp",
"BulletDynamics/Featherstone/btMultiBodyFixedConstraint.cpp",
"BulletDynamics/Featherstone/btMultiBodyGearConstraint.cpp",
"BulletDynamics/Featherstone/btMultiBodyJointLimitConstraint.cpp",
"BulletDynamics/Featherstone/btMultiBodyJointMotor.cpp",
"BulletDynamics/Featherstone/btMultiBodyMLCPConstraintSolver.cpp",
"BulletDynamics/Featherstone/btMultiBodyPoint2Point.cpp",
"BulletDynamics/Featherstone/btMultiBodySliderConstraint.cpp",
"BulletDynamics/Featherstone/btMultiBodySphericalJointMotor.cpp",
"BulletDynamics/MLCPSolvers/btDantzigLCP.cpp",
"BulletDynamics/MLCPSolvers/btMLCPSolver.cpp",
"BulletDynamics/MLCPSolvers/btLemkeAlgorithm.cpp",
# BulletInverseDynamics
, "BulletInverseDynamics/IDMath.cpp"
, "BulletInverseDynamics/MultiBodyTree.cpp"
, "BulletInverseDynamics/details/MultiBodyTreeInitCache.cpp"
, "BulletInverseDynamics/details/MultiBodyTreeImpl.cpp"
"BulletInverseDynamics/IDMath.cpp",
"BulletInverseDynamics/MultiBodyTree.cpp",
"BulletInverseDynamics/details/MultiBodyTreeInitCache.cpp",
"BulletInverseDynamics/details/MultiBodyTreeImpl.cpp",
# BulletSoftBody
, "BulletSoftBody/btSoftBody.cpp"
, "BulletSoftBody/btSoftBodyConcaveCollisionAlgorithm.cpp"
, "BulletSoftBody/btSoftBodyHelpers.cpp"
, "BulletSoftBody/btSoftBodyRigidBodyCollisionConfiguration.cpp"
, "BulletSoftBody/btSoftRigidCollisionAlgorithm.cpp"
, "BulletSoftBody/btSoftRigidDynamicsWorld.cpp"
, "BulletSoftBody/btSoftMultiBodyDynamicsWorld.cpp"
, "BulletSoftBody/btSoftSoftCollisionAlgorithm.cpp"
, "BulletSoftBody/btDefaultSoftBodySolver.cpp"
, "BulletSoftBody/btDeformableBackwardEulerObjective.cpp"
, "BulletSoftBody/btDeformableBodySolver.cpp"
, "BulletSoftBody/btDeformableMultiBodyConstraintSolver.cpp"
, "BulletSoftBody/btDeformableContactProjection.cpp"
, "BulletSoftBody/btDeformableMultiBodyDynamicsWorld.cpp"
, "BulletSoftBody/btDeformableContactConstraint.cpp"
"BulletSoftBody/btSoftBody.cpp",
"BulletSoftBody/btSoftBodyConcaveCollisionAlgorithm.cpp",
"BulletSoftBody/btSoftBodyHelpers.cpp",
"BulletSoftBody/btSoftBodyRigidBodyCollisionConfiguration.cpp",
"BulletSoftBody/btSoftRigidCollisionAlgorithm.cpp",
"BulletSoftBody/btSoftRigidDynamicsWorld.cpp",
"BulletSoftBody/btSoftMultiBodyDynamicsWorld.cpp",
"BulletSoftBody/btSoftSoftCollisionAlgorithm.cpp",
"BulletSoftBody/btDefaultSoftBodySolver.cpp",
"BulletSoftBody/btDeformableBackwardEulerObjective.cpp",
"BulletSoftBody/btDeformableBodySolver.cpp",
"BulletSoftBody/btDeformableMultiBodyConstraintSolver.cpp",
"BulletSoftBody/btDeformableContactProjection.cpp",
"BulletSoftBody/btDeformableMultiBodyDynamicsWorld.cpp",
"BulletSoftBody/btDeformableContactConstraint.cpp",
# clew
, "clew/clew.c"
"clew/clew.c",
# LinearMath
, "LinearMath/btAlignedAllocator.cpp"
, "LinearMath/btConvexHull.cpp"
, "LinearMath/btConvexHullComputer.cpp"
, "LinearMath/btGeometryUtil.cpp"
, "LinearMath/btPolarDecomposition.cpp"
, "LinearMath/btQuickprof.cpp"
, "LinearMath/btSerializer.cpp"
, "LinearMath/btSerializer64.cpp"
, "LinearMath/btThreads.cpp"
, "LinearMath/btVector3.cpp"
, "LinearMath/TaskScheduler/btTaskScheduler.cpp"
, "LinearMath/TaskScheduler/btThreadSupportPosix.cpp"
, "LinearMath/TaskScheduler/btThreadSupportWin32.cpp"
"LinearMath/btAlignedAllocator.cpp",
"LinearMath/btConvexHull.cpp",
"LinearMath/btConvexHullComputer.cpp",
"LinearMath/btGeometryUtil.cpp",
"LinearMath/btPolarDecomposition.cpp",
"LinearMath/btQuickprof.cpp",
"LinearMath/btSerializer.cpp",
"LinearMath/btSerializer64.cpp",
"LinearMath/btThreads.cpp",
"LinearMath/btVector3.cpp",
"LinearMath/TaskScheduler/btTaskScheduler.cpp",
"LinearMath/TaskScheduler/btThreadSupportPosix.cpp",
"LinearMath/TaskScheduler/btThreadSupportWin32.cpp",
]
thirdparty_sources = [thirdparty_dir + file for file in bullet2_src]
# Treat Bullet headers as system headers to avoid raising warnings. Not supported on MSVC.
if not env.msvc:
env_bullet.Append(CPPFLAGS=['-isystem', Dir(thirdparty_dir).path])
env_bullet.Append(CPPFLAGS=["-isystem", Dir(thirdparty_dir).path])
else:
env_bullet.Prepend(CPPPATH=[thirdparty_dir])
# if env['target'] == "debug" or env['target'] == "release_debug":
+3
View File
@@ -1,14 +1,17 @@
def can_build(env, platform):
return True
def configure(env):
pass
def get_doc_classes():
return [
"BulletPhysicsDirectBodyState",
"BulletPhysicsServer",
]
def get_doc_path():
return "doc_classes"
+3 -4
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
Import('env')
Import('env_modules')
Import("env")
Import("env_modules")
env_camera = env_modules.Clone()
@@ -10,7 +10,7 @@ if env["platform"] == "iphone":
modules_sources = []
env_camera.add_source_files(modules_sources, "register_types.cpp")
env_camera.add_source_files(modules_sources, "camera_ios.mm")
mod_lib = env_modules.add_library('#bin/libgodot_camera_module' + env['LIBSUFFIX'], modules_sources)
mod_lib = env_modules.add_library("#bin/libgodot_camera_module" + env["LIBSUFFIX"], modules_sources)
elif env["platform"] == "windows":
env_camera.add_source_files(env.modules_sources, "register_types.cpp")
@@ -19,4 +19,3 @@ elif env["platform"] == "windows":
elif env["platform"] == "osx":
env_camera.add_source_files(env.modules_sources, "register_types.cpp")
env_camera.add_source_files(env.modules_sources, "camera_osx.mm")
+2 -1
View File
@@ -1,5 +1,6 @@
def can_build(env, platform):
return platform == 'iphone' or platform == 'osx' or platform == 'windows'
return platform == "iphone" or platform == "osx" or platform == "windows"
def configure(env):
pass
+2 -2
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
Import('env')
Import('env_modules')
Import("env")
Import("env_modules")
env_csg = env_modules.Clone()
+3
View File
@@ -1,9 +1,11 @@
def can_build(env, platform):
return True
def configure(env):
pass
def get_doc_classes():
return [
"CSGBox",
@@ -17,5 +19,6 @@ def get_doc_classes():
"CSGTorus",
]
def get_doc_path():
return "doc_classes"
+3 -3
View File
@@ -1,14 +1,14 @@
#!/usr/bin/env python
Import('env')
Import('env_modules')
Import("env")
Import("env_modules")
env_cvtt = env_modules.Clone()
# Thirdparty source files
thirdparty_dir = "#thirdparty/cvtt/"
thirdparty_sources = [
"ConvectionKernels.cpp"
"ConvectionKernels.cpp",
]
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
+2 -1
View File
@@ -1,5 +1,6 @@
def can_build(env, platform):
return env['tools']
return env["tools"]
def configure(env):
pass
+2 -2
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
Import('env')
Import('env_modules')
Import("env")
Import("env_modules")
env_dds = env_modules.Clone()
+1
View File
@@ -1,5 +1,6 @@
def can_build(env, platform):
return True
def configure(env):
pass
+3 -3
View File
@@ -1,13 +1,13 @@
#!/usr/bin/env python
Import('env')
Import('env_modules')
Import("env")
Import("env_modules")
env_enet = env_modules.Clone()
# Thirdparty source files
if env['builtin_enet']:
if env["builtin_enet"]:
thirdparty_dir = "#thirdparty/enet/"
thirdparty_sources = [
"godot.cpp",
+3
View File
@@ -1,13 +1,16 @@
def can_build(env, platform):
return True
def configure(env):
pass
def get_doc_classes():
return [
"NetworkedMultiplayerENet",
]
def get_doc_path():
return "doc_classes"
+17 -17
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
Import('env')
Import('env_modules')
Import("env")
Import("env_modules")
env_etc = env_modules.Clone()
@@ -9,21 +9,21 @@ env_etc = env_modules.Clone()
# Not unbundled so far since not widespread as shared library
thirdparty_dir = "#thirdparty/etc2comp/"
thirdparty_sources = [
"EtcBlock4x4.cpp",
"EtcBlock4x4Encoding.cpp",
"EtcBlock4x4Encoding_ETC1.cpp",
"EtcBlock4x4Encoding_R11.cpp",
"EtcBlock4x4Encoding_RG11.cpp",
"EtcBlock4x4Encoding_RGB8A1.cpp",
"EtcBlock4x4Encoding_RGB8.cpp",
"EtcBlock4x4Encoding_RGBA8.cpp",
"Etc.cpp",
"EtcDifferentialTrys.cpp",
"EtcFilter.cpp",
"EtcImage.cpp",
"EtcIndividualTrys.cpp",
"EtcMath.cpp",
"EtcSortedBlockList.cpp",
"EtcBlock4x4.cpp",
"EtcBlock4x4Encoding.cpp",
"EtcBlock4x4Encoding_ETC1.cpp",
"EtcBlock4x4Encoding_R11.cpp",
"EtcBlock4x4Encoding_RG11.cpp",
"EtcBlock4x4Encoding_RGB8A1.cpp",
"EtcBlock4x4Encoding_RGB8.cpp",
"EtcBlock4x4Encoding_RGBA8.cpp",
"Etc.cpp",
"EtcDifferentialTrys.cpp",
"EtcFilter.cpp",
"EtcImage.cpp",
"EtcIndividualTrys.cpp",
"EtcMath.cpp",
"EtcSortedBlockList.cpp",
]
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
+2 -1
View File
@@ -1,5 +1,6 @@
def can_build(env, platform):
return env['tools']
return env["tools"]
def configure(env):
pass
+14 -14
View File
@@ -1,12 +1,12 @@
#!/usr/bin/env python
Import('env')
Import('env_modules')
Import("env")
Import("env_modules")
env_freetype = env_modules.Clone()
# Thirdparty source files
if env['builtin_freetype']:
if env["builtin_freetype"]:
thirdparty_dir = "#thirdparty/freetype/"
thirdparty_sources = [
"src/autofit/autofit.c",
@@ -53,31 +53,31 @@ if env['builtin_freetype']:
]
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
if env['platform'] == 'uwp':
if env["platform"] == "uwp":
# Include header for UWP to fix build issues
env_freetype.Append(CCFLAGS=['/FI', '"modules/freetype/uwpdef.h"'])
env_freetype.Append(CCFLAGS=["/FI", '"modules/freetype/uwpdef.h"'])
# Globally too, as freetype is used in scene (see bottom)
env.Append(CCFLAGS=['/FI', '"modules/freetype/uwpdef.h"'])
env.Append(CCFLAGS=["/FI", '"modules/freetype/uwpdef.h"'])
env_freetype.Prepend(CPPPATH=[thirdparty_dir + "/include"])
# Also needed in main env for scene/
env.Prepend(CPPPATH=[thirdparty_dir + "/include"])
env_freetype.Append(CPPDEFINES=['FT2_BUILD_LIBRARY', 'FT_CONFIG_OPTION_USE_PNG'])
if (env['target'] == 'debug'):
env_freetype.Append(CPPDEFINES=['ZLIB_DEBUG'])
env_freetype.Append(CPPDEFINES=["FT2_BUILD_LIBRARY", "FT_CONFIG_OPTION_USE_PNG"])
if env["target"] == "debug":
env_freetype.Append(CPPDEFINES=["ZLIB_DEBUG"])
# Also requires libpng headers
if env['builtin_libpng']:
if env["builtin_libpng"]:
env_freetype.Prepend(CPPPATH=["#thirdparty/libpng"])
sfnt = thirdparty_dir + 'src/sfnt/sfnt.c'
sfnt = thirdparty_dir + "src/sfnt/sfnt.c"
# Must be done after all CPPDEFINES are being set so we can copy them.
if env['platform'] == 'javascript':
if env["platform"] == "javascript":
# Forcibly undefine this macro so SIMD is not used in this file,
# since currently unsupported in WASM
tmp_env = env_freetype.Clone()
tmp_env.Append(CPPFLAGS=['-U__OPTIMIZE__'])
tmp_env.Append(CPPFLAGS=["-U__OPTIMIZE__"])
sfnt = tmp_env.Object(sfnt)
thirdparty_sources += [sfnt]
@@ -91,7 +91,7 @@ if env['builtin_freetype']:
# and then plain strings for system library. We insert between the two.
inserted = False
for idx, linklib in enumerate(env["LIBS"]):
if isinstance(linklib, (str, bytes)): # first system lib such as "X11", otherwise SCons lib object
if isinstance(linklib, (str, bytes)): # first system lib such as "X11", otherwise SCons lib object
env["LIBS"].insert(idx, lib)
inserted = True
break
+1
View File
@@ -1,5 +1,6 @@
def can_build(env, platform):
return True
def configure(env):
pass
+9 -6
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
Import('env')
Import('env_modules')
Import("env")
Import("env_modules")
env_gdnative = env_modules.Clone()
env_gdnative.add_source_files(env.modules_sources, "gdnative.cpp")
@@ -12,9 +12,9 @@ env_gdnative.add_source_files(env.modules_sources, "nativescript/*.cpp")
env_gdnative.add_source_files(env.modules_sources, "gdnative_library_singleton_editor.cpp")
env_gdnative.add_source_files(env.modules_sources, "gdnative_library_editor_plugin.cpp")
env_gdnative.Prepend(CPPPATH=['#modules/gdnative/include/'])
env_gdnative.Prepend(CPPPATH=["#modules/gdnative/include/"])
Export('env_gdnative')
Export("env_gdnative")
SConscript("net/SCsub")
SConscript("arvr/SCsub")
@@ -25,8 +25,11 @@ SConscript("videodecoder/SCsub")
from platform_methods import run_in_subprocess
import gdnative_builders
_, gensource = env_gdnative.CommandNoCache(['include/gdnative_api_struct.gen.h', 'gdnative_api_struct.gen.cpp'],
'gdnative_api.json', run_in_subprocess(gdnative_builders.build_gdnative_api_struct))
_, gensource = env_gdnative.CommandNoCache(
["include/gdnative_api_struct.gen.h", "gdnative_api_struct.gen.cpp"],
"gdnative_api.json",
run_in_subprocess(gdnative_builders.build_gdnative_api_struct),
)
env_gdnative.add_source_files(env.modules_sources, [gensource])
env.use_ptrcall = True
+3 -3
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env python
Import('env')
Import('env_gdnative')
Import("env")
Import("env_gdnative")
env_gdnative.add_source_files(env.modules_sources, '*.cpp')
env_gdnative.add_source_files(env.modules_sources, "*.cpp")
+3 -2
View File
@@ -1,5 +1,6 @@
def can_build(env, platform):
return True
return True
def configure(env):
pass
pass
+3
View File
@@ -1,9 +1,11 @@
def can_build(env, platform):
return True
def configure(env):
env.use_ptrcall = True
def get_doc_classes():
return [
"@NativeScript",
@@ -20,5 +22,6 @@ def get_doc_classes():
"WebRTCDataChannelGDNative",
]
def get_doc_path():
return "doc_classes"
+155 -115
View File
@@ -8,209 +8,249 @@ from platform_methods import subprocess_main
def _spaced(e):
return e if e[-1] == '*' else e + ' '
return e if e[-1] == "*" else e + " "
def _build_gdnative_api_struct_header(api):
out = [
'/* THIS FILE IS GENERATED DO NOT EDIT */',
'#ifndef GODOT_GDNATIVE_API_STRUCT_H',
'#define GODOT_GDNATIVE_API_STRUCT_H',
'',
'#include <gdnative/gdnative.h>',
'#include <android/godot_android.h>',
'#include <arvr/godot_arvr.h>',
'#include <nativescript/godot_nativescript.h>',
'#include <net/godot_net.h>',
'#include <pluginscript/godot_pluginscript.h>',
'#include <videodecoder/godot_videodecoder.h>',
'',
'#ifdef __cplusplus',
"/* THIS FILE IS GENERATED DO NOT EDIT */",
"#ifndef GODOT_GDNATIVE_API_STRUCT_H",
"#define GODOT_GDNATIVE_API_STRUCT_H",
"",
"#include <gdnative/gdnative.h>",
"#include <android/godot_android.h>",
"#include <arvr/godot_arvr.h>",
"#include <nativescript/godot_nativescript.h>",
"#include <net/godot_net.h>",
"#include <pluginscript/godot_pluginscript.h>",
"#include <videodecoder/godot_videodecoder.h>",
"",
"#ifdef __cplusplus",
'extern "C" {',
'#endif',
'',
'enum GDNATIVE_API_TYPES {',
'\tGDNATIVE_' + api['core']['type'] + ','
"#endif",
"",
"enum GDNATIVE_API_TYPES {",
"\tGDNATIVE_" + api["core"]["type"] + ",",
]
for ext in api['extensions']:
out += ['\tGDNATIVE_EXT_' + ext['type'] + ',']
for ext in api["extensions"]:
out += ["\tGDNATIVE_EXT_" + ext["type"] + ","]
out += ['};', '']
out += ["};", ""]
def generate_extension_struct(name, ext, include_version=True):
ret_val = []
if ext['next']:
ret_val += generate_extension_struct(name, ext['next'])
if ext["next"]:
ret_val += generate_extension_struct(name, ext["next"])
ret_val += [
'typedef struct godot_gdnative_ext_' + name + ('' if not include_version else ('_{0}_{1}'.format(ext['version']['major'], ext['version']['minor']))) + '_api_struct {',
'\tunsigned int type;',
'\tgodot_gdnative_api_version version;',
'\tconst godot_gdnative_api_struct *next;'
"typedef struct godot_gdnative_ext_"
+ name
+ ("" if not include_version else ("_{0}_{1}".format(ext["version"]["major"], ext["version"]["minor"])))
+ "_api_struct {",
"\tunsigned int type;",
"\tgodot_gdnative_api_version version;",
"\tconst godot_gdnative_api_struct *next;",
]
for funcdef in ext['api']:
args = ', '.join(['%s%s' % (_spaced(t), n) for t, n in funcdef['arguments']])
ret_val.append('\t%s(*%s)(%s);' % (_spaced(funcdef['return_type']), funcdef['name'], args))
for funcdef in ext["api"]:
args = ", ".join(["%s%s" % (_spaced(t), n) for t, n in funcdef["arguments"]])
ret_val.append("\t%s(*%s)(%s);" % (_spaced(funcdef["return_type"]), funcdef["name"], args))
ret_val += ['} godot_gdnative_ext_' + name + ('' if not include_version else ('_{0}_{1}'.format(ext['version']['major'], ext['version']['minor']))) + '_api_struct;', '']
ret_val += [
"} godot_gdnative_ext_"
+ name
+ ("" if not include_version else ("_{0}_{1}".format(ext["version"]["major"], ext["version"]["minor"])))
+ "_api_struct;",
"",
]
return ret_val
def generate_core_extension_struct(core):
ret_val = []
if core['next']:
ret_val += generate_core_extension_struct(core['next'])
if core["next"]:
ret_val += generate_core_extension_struct(core["next"])
ret_val += [
'typedef struct godot_gdnative_core_' + ('{0}_{1}'.format(core['version']['major'], core['version']['minor'])) + '_api_struct {',
'\tunsigned int type;',
'\tgodot_gdnative_api_version version;',
'\tconst godot_gdnative_api_struct *next;',
"typedef struct godot_gdnative_core_"
+ ("{0}_{1}".format(core["version"]["major"], core["version"]["minor"]))
+ "_api_struct {",
"\tunsigned int type;",
"\tgodot_gdnative_api_version version;",
"\tconst godot_gdnative_api_struct *next;",
]
for funcdef in core['api']:
args = ', '.join(['%s%s' % (_spaced(t), n) for t, n in funcdef['arguments']])
ret_val.append('\t%s(*%s)(%s);' % (_spaced(funcdef['return_type']), funcdef['name'], args))
for funcdef in core["api"]:
args = ", ".join(["%s%s" % (_spaced(t), n) for t, n in funcdef["arguments"]])
ret_val.append("\t%s(*%s)(%s);" % (_spaced(funcdef["return_type"]), funcdef["name"], args))
ret_val += ['} godot_gdnative_core_' + '{0}_{1}'.format(core['version']['major'], core['version']['minor']) + '_api_struct;', '']
ret_val += [
"} godot_gdnative_core_"
+ "{0}_{1}".format(core["version"]["major"], core["version"]["minor"])
+ "_api_struct;",
"",
]
return ret_val
for ext in api['extensions']:
name = ext['name']
for ext in api["extensions"]:
name = ext["name"]
out += generate_extension_struct(name, ext, False)
if api['core']['next']:
out += generate_core_extension_struct(api['core']['next'])
if api["core"]["next"]:
out += generate_core_extension_struct(api["core"]["next"])
out += [
'typedef struct godot_gdnative_core_api_struct {',
'\tunsigned int type;',
'\tgodot_gdnative_api_version version;',
'\tconst godot_gdnative_api_struct *next;',
'\tunsigned int num_extensions;',
'\tconst godot_gdnative_api_struct **extensions;',
"typedef struct godot_gdnative_core_api_struct {",
"\tunsigned int type;",
"\tgodot_gdnative_api_version version;",
"\tconst godot_gdnative_api_struct *next;",
"\tunsigned int num_extensions;",
"\tconst godot_gdnative_api_struct **extensions;",
]
for funcdef in api['core']['api']:
args = ', '.join(['%s%s' % (_spaced(t), n) for t, n in funcdef['arguments']])
out.append('\t%s(*%s)(%s);' % (_spaced(funcdef['return_type']), funcdef['name'], args))
for funcdef in api["core"]["api"]:
args = ", ".join(["%s%s" % (_spaced(t), n) for t, n in funcdef["arguments"]])
out.append("\t%s(*%s)(%s);" % (_spaced(funcdef["return_type"]), funcdef["name"], args))
out += [
'} godot_gdnative_core_api_struct;',
'',
'#ifdef __cplusplus',
'}',
'#endif',
'',
'#endif // GODOT_GDNATIVE_API_STRUCT_H',
''
"} godot_gdnative_core_api_struct;",
"",
"#ifdef __cplusplus",
"}",
"#endif",
"",
"#endif // GODOT_GDNATIVE_API_STRUCT_H",
"",
]
return '\n'.join(out)
return "\n".join(out)
def _build_gdnative_api_struct_source(api):
out = [
'/* THIS FILE IS GENERATED DO NOT EDIT */',
'',
'#include <gdnative_api_struct.gen.h>',
''
]
out = ["/* THIS FILE IS GENERATED DO NOT EDIT */", "", "#include <gdnative_api_struct.gen.h>", ""]
def get_extension_struct_name(name, ext, include_version=True):
return 'godot_gdnative_ext_' + name + ('' if not include_version else ('_{0}_{1}'.format(ext['version']['major'], ext['version']['minor']))) + '_api_struct'
return (
"godot_gdnative_ext_"
+ name
+ ("" if not include_version else ("_{0}_{1}".format(ext["version"]["major"], ext["version"]["minor"])))
+ "_api_struct"
)
def get_extension_struct_instance_name(name, ext, include_version=True):
return 'api_extension_' + name + ('' if not include_version else ('_{0}_{1}'.format(ext['version']['major'], ext['version']['minor']))) + '_struct'
return (
"api_extension_"
+ name
+ ("" if not include_version else ("_{0}_{1}".format(ext["version"]["major"], ext["version"]["minor"])))
+ "_struct"
)
def get_extension_struct_definition(name, ext, include_version=True):
ret_val = []
if ext['next']:
ret_val += get_extension_struct_definition(name, ext['next'])
if ext["next"]:
ret_val += get_extension_struct_definition(name, ext["next"])
ret_val += [
'extern const ' + get_extension_struct_name(name, ext, include_version) + ' ' + get_extension_struct_instance_name(name, ext, include_version) + ' = {',
'\tGDNATIVE_EXT_' + ext['type'] + ',',
'\t{' + str(ext['version']['major']) + ', ' + str(ext['version']['minor']) + '},',
'\t' + ('NULL' if not ext['next'] else ('(const godot_gdnative_api_struct *)&' + get_extension_struct_instance_name(name, ext['next']))) + ','
"extern const "
+ get_extension_struct_name(name, ext, include_version)
+ " "
+ get_extension_struct_instance_name(name, ext, include_version)
+ " = {",
"\tGDNATIVE_EXT_" + ext["type"] + ",",
"\t{" + str(ext["version"]["major"]) + ", " + str(ext["version"]["minor"]) + "},",
"\t"
+ (
"NULL"
if not ext["next"]
else ("(const godot_gdnative_api_struct *)&" + get_extension_struct_instance_name(name, ext["next"]))
)
+ ",",
]
for funcdef in ext['api']:
ret_val.append('\t%s,' % funcdef['name'])
for funcdef in ext["api"]:
ret_val.append("\t%s," % funcdef["name"])
ret_val += ['};\n']
ret_val += ["};\n"]
return ret_val
def get_core_struct_definition(core):
ret_val = []
if core['next']:
ret_val += get_core_struct_definition(core['next'])
if core["next"]:
ret_val += get_core_struct_definition(core["next"])
ret_val += [
'extern const godot_gdnative_core_' + ('{0}_{1}_api_struct api_{0}_{1}'.format(core['version']['major'], core['version']['minor'])) + ' = {',
'\tGDNATIVE_' + core['type'] + ',',
'\t{' + str(core['version']['major']) + ', ' + str(core['version']['minor']) + '},',
'\t' + ('NULL' if not core['next'] else ('(const godot_gdnative_api_struct *)& api_{0}_{1}'.format(core['next']['version']['major'], core['next']['version']['minor']))) + ','
"extern const godot_gdnative_core_"
+ ("{0}_{1}_api_struct api_{0}_{1}".format(core["version"]["major"], core["version"]["minor"]))
+ " = {",
"\tGDNATIVE_" + core["type"] + ",",
"\t{" + str(core["version"]["major"]) + ", " + str(core["version"]["minor"]) + "},",
"\t"
+ (
"NULL"
if not core["next"]
else (
"(const godot_gdnative_api_struct *)& api_{0}_{1}".format(
core["next"]["version"]["major"], core["next"]["version"]["minor"]
)
)
)
+ ",",
]
for funcdef in core['api']:
ret_val.append('\t%s,' % funcdef['name'])
for funcdef in core["api"]:
ret_val.append("\t%s," % funcdef["name"])
ret_val += ['};\n']
ret_val += ["};\n"]
return ret_val
for ext in api['extensions']:
name = ext['name']
for ext in api["extensions"]:
name = ext["name"]
out += get_extension_struct_definition(name, ext, False)
out += ['', 'const godot_gdnative_api_struct *gdnative_extensions_pointers[] = {']
out += ["", "const godot_gdnative_api_struct *gdnative_extensions_pointers[] = {"]
for ext in api['extensions']:
name = ext['name']
out += ['\t(godot_gdnative_api_struct *)&api_extension_' + name + '_struct,']
for ext in api["extensions"]:
name = ext["name"]
out += ["\t(godot_gdnative_api_struct *)&api_extension_" + name + "_struct,"]
out += ['};\n']
out += ["};\n"]
if api['core']['next']:
out += get_core_struct_definition(api['core']['next'])
if api["core"]["next"]:
out += get_core_struct_definition(api["core"]["next"])
out += [
'extern const godot_gdnative_core_api_struct api_struct = {',
'\tGDNATIVE_' + api['core']['type'] + ',',
'\t{' + str(api['core']['version']['major']) + ', ' + str(api['core']['version']['minor']) + '},',
'\t(const godot_gdnative_api_struct *)&api_1_1,',
'\t' + str(len(api['extensions'])) + ',',
'\tgdnative_extensions_pointers,',
"extern const godot_gdnative_core_api_struct api_struct = {",
"\tGDNATIVE_" + api["core"]["type"] + ",",
"\t{" + str(api["core"]["version"]["major"]) + ", " + str(api["core"]["version"]["minor"]) + "},",
"\t(const godot_gdnative_api_struct *)&api_1_1,",
"\t" + str(len(api["extensions"])) + ",",
"\tgdnative_extensions_pointers,",
]
for funcdef in api['core']['api']:
out.append('\t%s,' % funcdef['name'])
out.append('};\n')
for funcdef in api["core"]["api"]:
out.append("\t%s," % funcdef["name"])
out.append("};\n")
return '\n'.join(out)
return "\n".join(out)
def build_gdnative_api_struct(target, source, env):
with open(source[0], 'r') as fd:
with open(source[0], "r") as fd:
api = json.load(fd)
header, source = target
with open(header, 'w') as fd:
with open(header, "w") as fd:
fd.write(_build_gdnative_api_struct_header(api))
with open(source, 'w') as fd:
with open(source, "w") as fd:
fd.write(_build_gdnative_api_struct_source(api))
if __name__ == '__main__':
if __name__ == "__main__":
subprocess_main(globals())
+3 -3
View File
@@ -1,9 +1,9 @@
#!/usr/bin/env python
Import('env')
Import('env_gdnative')
Import("env")
Import("env_gdnative")
env_gdnative.add_source_files(env.modules_sources, '*.cpp')
env_gdnative.add_source_files(env.modules_sources, "*.cpp")
if "platform" in env and env["platform"] in ["linuxbsd", "iphone"]:
env.Append(LINKFLAGS=["-rdynamic"])
+4 -5
View File
@@ -1,13 +1,12 @@
#!/usr/bin/env python
Import('env')
Import('env_gdnative')
Import("env")
Import("env_gdnative")
env_net = env_gdnative.Clone()
has_webrtc = env_net["module_webrtc_enabled"]
if has_webrtc:
env_net.Append(CPPDEFINES=['WEBRTC_GDNATIVE_ENABLED'])
env_net.add_source_files(env.modules_sources, '*.cpp')
env_net.Append(CPPDEFINES=["WEBRTC_GDNATIVE_ENABLED"])
env_net.add_source_files(env.modules_sources, "*.cpp")
+3 -3
View File
@@ -1,6 +1,6 @@
#!/usr/bin/env python
Import('env')
Import('env_gdnative')
Import("env")
Import("env_gdnative")
env_gdnative.add_source_files(env.modules_sources, '*.cpp')
env_gdnative.add_source_files(env.modules_sources, "*.cpp")
+4 -4
View File
@@ -1,9 +1,9 @@
#!/usr/bin/env python
Import('env')
Import('env_modules')
Import("env")
Import("env_modules")
env_vsdecoder_gdnative = env_modules.Clone()
env_vsdecoder_gdnative.Prepend(CPPPATH=['#modules/gdnative/include/'])
env_vsdecoder_gdnative.add_source_files(env.modules_sources, '*.cpp')
env_vsdecoder_gdnative.Prepend(CPPPATH=["#modules/gdnative/include/"])
env_vsdecoder_gdnative.add_source_files(env.modules_sources, "*.cpp")
+17 -17
View File
@@ -1,25 +1,25 @@
#!/usr/bin/env python
Import('env')
Import('env_modules')
Import("env")
Import("env_modules")
env_navigation = env_modules.Clone()
# Recast Thirdparty source files
if env['builtin_recast']:
if env["builtin_recast"]:
thirdparty_dir = "#thirdparty/recastnavigation/Recast/"
thirdparty_sources = [
"Source/Recast.cpp",
"Source/RecastAlloc.cpp",
"Source/RecastArea.cpp",
"Source/RecastAssert.cpp",
"Source/RecastContour.cpp",
"Source/RecastFilter.cpp",
"Source/RecastLayers.cpp",
"Source/RecastMesh.cpp",
"Source/RecastMeshDetail.cpp",
"Source/RecastRasterization.cpp",
"Source/RecastRegion.cpp",
"Source/Recast.cpp",
"Source/RecastAlloc.cpp",
"Source/RecastArea.cpp",
"Source/RecastAssert.cpp",
"Source/RecastContour.cpp",
"Source/RecastFilter.cpp",
"Source/RecastLayers.cpp",
"Source/RecastMesh.cpp",
"Source/RecastMeshDetail.cpp",
"Source/RecastRasterization.cpp",
"Source/RecastRegion.cpp",
]
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
@@ -31,11 +31,11 @@ if env['builtin_recast']:
# RVO Thirdparty source files
if env['builtin_rvo2']:
if env["builtin_rvo2"]:
thirdparty_dir = "#thirdparty/rvo2"
thirdparty_sources = [
"/src/Agent.cpp",
"/src/KdTree.cpp",
"/src/Agent.cpp",
"/src/KdTree.cpp",
]
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]
+1
View File
@@ -1,5 +1,6 @@
def can_build(env, platform):
return True
def configure(env):
pass
+5 -5
View File
@@ -1,19 +1,19 @@
#!/usr/bin/env python
Import('env')
Import('env_modules')
Import("env")
Import("env_modules")
env_gdscript = env_modules.Clone()
env_gdscript.add_source_files(env.modules_sources, "*.cpp")
if env['tools']:
if env["tools"]:
env_gdscript.add_source_files(env.modules_sources, "./editor/*.cpp")
# Those two modules are required for the language server protocol
if env['module_jsonrpc_enabled'] and env['module_websocket_enabled']:
if env["module_jsonrpc_enabled"] and env["module_websocket_enabled"]:
env_gdscript.add_source_files(env.modules_sources, "./language_server/*.cpp")
else:
# Using a define in the disabled case, to avoid having an extra define
# in regular builds where all modules are enabled.
env_gdscript.Append(CPPDEFINES=['GDSCRIPT_NO_LSP'])
env_gdscript.Append(CPPDEFINES=["GDSCRIPT_NO_LSP"])
+3
View File
@@ -1,9 +1,11 @@
def can_build(env, platform):
return True
def configure(env):
pass
def get_doc_classes():
return [
"@GDScript",
@@ -12,5 +14,6 @@ def get_doc_classes():
"GDScriptNativeClass",
]
def get_doc_path():
return "doc_classes"
+6 -6
View File
@@ -1,12 +1,12 @@
#!/usr/bin/env python
Import('env')
Import('env_modules')
Import("env")
Import("env_modules")
env_glslang = env_modules.Clone()
# Thirdparty source files
if env['builtin_glslang']:
if env["builtin_glslang"]:
thirdparty_dir = "#thirdparty/glslang/"
thirdparty_sources = [
"glslang/MachineIndependent/RemoveTree.cpp",
@@ -48,10 +48,10 @@ if env['builtin_glslang']:
"SPIRV/doc.cpp",
"SPIRV/SPVRemapper.cpp",
"SPIRV/SpvPostProcess.cpp",
"SPIRV/Logger.cpp"
"SPIRV/Logger.cpp",
]
if (env["platform"]=="windows"):
if env["platform"] == "windows":
thirdparty_sources.append("glslang/OSDependent/Windows/ossource.cpp")
else:
thirdparty_sources.append("glslang/OSDependent/Unix/ossource.cpp")
@@ -60,7 +60,7 @@ if env['builtin_glslang']:
# Treat glslang headers as system headers to avoid raising warnings. Not supported on MSVC.
if not env.msvc:
env_glslang.Append(CPPFLAGS=['-isystem', Dir(thirdparty_dir).path])
env_glslang.Append(CPPFLAGS=["-isystem", Dir(thirdparty_dir).path])
else:
env_glslang.Prepend(CPPPATH=[thirdparty_dir])
+1
View File
@@ -1,5 +1,6 @@
def can_build(env, platform):
return True
def configure(env):
pass
+2 -2
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
Import('env')
Import('env_modules')
Import("env")
Import("env_modules")
env_gridmap = env_modules.Clone()
+3
View File
@@ -1,13 +1,16 @@
def can_build(env, platform):
return True
def configure(env):
pass
def get_doc_classes():
return [
"GridMap",
]
def get_doc_path():
return "doc_classes"
+2 -2
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
Import('env')
Import('env_modules')
Import("env")
Import("env_modules")
env_hdr = env_modules.Clone()
+1
View File
@@ -1,5 +1,6 @@
def can_build(env, platform):
return True
def configure(env):
pass
+2 -2
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
Import('env')
Import('env_modules')
Import("env")
Import("env_modules")
env_jpg = env_modules.Clone()
+1
View File
@@ -1,5 +1,6 @@
def can_build(env, platform):
return True
def configure(env):
pass
+2 -2
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env python
Import('env')
Import('env_modules')
Import("env")
Import("env_modules")
env_jsonrpc = env_modules.Clone()
env_jsonrpc.add_source_files(env.modules_sources, "*.cpp")
+3 -2
View File
@@ -1,5 +1,6 @@
def can_build(env, platform):
return True
return True
def configure(env):
pass
pass
+4 -4
View File
@@ -1,11 +1,11 @@
#!/usr/bin/env python
Import('env')
Import('env_modules')
Import("env")
Import("env_modules")
env_mbed_tls = env_modules.Clone()
if env['builtin_mbedtls']:
if env["builtin_mbedtls"]:
# Thirdparty source files
thirdparty_sources = [
"aes.c",
@@ -86,7 +86,7 @@ if env['builtin_mbedtls']:
"x509_csr.c",
"x509write_crt.c",
"x509write_csr.c",
"xtea.c"
"xtea.c",
]
thirdparty_dir = "#thirdparty/mbedtls/library/"
+1
View File
@@ -1,5 +1,6 @@
def can_build(env, platform):
return True
def configure(env):
pass
+3 -3
View File
@@ -1,8 +1,8 @@
#!/usr/bin/env python
Import('env')
Import('env_modules')
Import("env")
Import("env_modules")
env_mobile_vr = env_modules.Clone()
env_mobile_vr.add_source_files(env.modules_sources, '*.cpp')
env_mobile_vr.add_source_files(env.modules_sources, "*.cpp")

Some files were not shown because too many files have changed in this diff Show More