Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rubberduckycooly
GitHub Repository: rubberduckycooly/Sonic-Mania-Decompilation
Path: blob/master/SonicMania/objectcmake.py
338 views
1
import os
2
3
filenames = []
4
5
for dir_, _, files in os.walk("Objects"):
6
for file_name in files:
7
rel_dir = os.path.relpath(dir_, "Objects")
8
filenames.append(f"{rel_dir}/{file_name}")
9
10
files = ["\t${GAME_NAME}/Objects/" + f + "\n" for f in filenames if f.endswith(".c") and not f.endswith("All.c")]
11
12
with open("Objects.cmake", "w") as f:
13
f.writelines(["set(GENERATED_SOURCES\n"] + files + [")"])
14
15