Skip to content

Commit 28b6d74

Browse files
committed
Add subdirectories to source file collection logic in SConstruct using os.walk
Added automatic file collection using os.walk so that source files in subdirectories of src/ get properly detected by SConstruct.
1 parent 3ae88f7 commit 28b6d74

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

SConstruct

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,11 @@ Run the following command to download godot-cpp:
3838
env = SConscript("godot-cpp/SConstruct", {"env": env, "customs": customs})
3939

4040
env.Append(CPPPATH=["src/"])
41-
sources = Glob("src/*.cpp")
41+
sources = []
42+
for root, folders, files in os.walk("src"):
43+
if root.endswith("gen"):
44+
continue
45+
sources += Glob(os.path.join(root, "*.cpp"))
4246

4347
if env["target"] in ["editor", "template_debug"]:
4448
try:

0 commit comments

Comments
 (0)