-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5435403
commit f7ba15f
Showing
7 changed files
with
63 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule godot-cpp
updated
5 files
+1 −1 | .gitignore | |
+1 −1 | CMakeLists.txt | |
+54 −20 | SConstruct | |
+13 −2 | gdextension/extension_api.json | |
+1 −1 | tools/windows.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/usr/bin/env python | ||
|
||
import os | ||
import re | ||
from pathlib import Path | ||
|
||
unity_batch_size = 32 | ||
|
||
|
||
def generate_unity_build(src, prefix="", gen_folder="obj", batch_size=unity_batch_size): | ||
if os.environ.get("FORCE_DISABLE_UNITY", "").lower() not in ["", "no", "false", "n"]: | ||
return src | ||
|
||
from pathlib import Path | ||
import math | ||
|
||
print("Generating source files for unity build:") | ||
res = [Path(str(f)).absolute().as_posix() | ||
for f in src if str(f).endswith(".cpp")] | ||
unity_dir = Path(gen_folder) | ||
unity_dir.mkdir(parents=True, exist_ok=True) | ||
unity_files = [] | ||
for i in range(math.ceil(len(res) / batch_size)): | ||
u_path = unity_dir / (prefix + ("unity_%d.cpp" % i)) | ||
print(u_path) | ||
unity_files.append(u_path.as_posix()) | ||
with u_path.open("w+") as unity_file: | ||
unity_file.write("\n".join( | ||
["/* generated by Scons */\n"] + ["#include \"%s\"\n" % f for f in res[:batch_size]])) | ||
res = res[batch_size:] | ||
|
||
print() | ||
return [f for f in src if not str(f).endswith(".cpp")] + [Path(f).absolute().as_posix() for f in unity_files] |