From 6f0b5bd38bae782da5fd966617b701168cda4e5e Mon Sep 17 00:00:00 2001 From: chkoupinator Date: Thu, 13 Nov 2025 23:53:18 +0100 Subject: [PATCH] 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 --- SConstruct | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/SConstruct b/SConstruct index 1d599d0d..b59eb3a7 100644 --- a/SConstruct +++ b/SConstruct @@ -38,7 +38,11 @@ Run the following command to download godot-cpp: env = SConscript("godot-cpp/SConstruct", {"env": env, "customs": customs}) env.Append(CPPPATH=["src/"]) -sources = Glob("src/*.cpp") +sources = [] +# Recursively add every .cpp file in the src directory. +for folder_path, _, _ in os.walk("src"): + if not folder_path.endswith(os.sep + "gen"): # The doc data in src/gen is added later + sources += Glob(os.path.join(folder_path, "*.cpp")) if env["target"] in ["editor", "template_debug"]: try: