Skip to content

Commit ff86afb

Browse files
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. Co-authored-by: Lukas Tenbrink <lukas.tenbrink@gmail.com>
1 parent 3ae88f7 commit ff86afb

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+
# Recursively add every .cpp file in the src directory.
43+
for folder_path, _, _ in os.walk("src"):
44+
if not folder_path.endswith("gen"): # The doc data in src/gen is added later
45+
sources += Glob(os.path.join(folder_path, "*.cpp"))
4246

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

0 commit comments

Comments
 (0)