diff options
author | reduz <reduzio@gmail.com> | 2021-07-11 19:30:33 -0300 |
---|---|---|
committer | reduz <reduzio@gmail.com> | 2021-07-13 09:25:14 -0300 |
commit | 5ad4f26659b435add8c4d36009be6a2222a0a624 (patch) | |
tree | dc19033d4ca18272ef5e8393ec95ff6667a903e1 /methods.py | |
parent | fc00a8390193220cea702d9ab684fb6c53d97a6b (diff) |
Implement the ability to disable classes
* This PR adds the ability to disable classes when building.
* For now it's only possible to do this via command like:
`scons disable_classes=RayCast2D,Area3D`
* Eventually, a proper UI will be implemented to create a build config file to do this at large scale, as well as detect what is used in the project.
Diffstat (limited to 'methods.py')
-rw-r--r-- | methods.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/methods.py b/methods.py index 1afd1ca0d4..fd9978657e 100644 --- a/methods.py +++ b/methods.py @@ -231,6 +231,18 @@ def is_module(path): return True +def write_disabled_classes(class_list): + f = open("core/disabled_classes.gen.h", "w") + f.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n") + f.write("#ifndef DISABLED_CLASSES_GEN_H\n") + f.write("#define DISABLED_CLASSES_GEN_H\n\n") + for c in class_list: + cs = c.strip() + if cs != "": + f.write("#define ClassDB_Disable_" + cs + " 1\n") + f.write("\n#endif\n") + + def write_modules(modules): includes_cpp = "" preregister_cpp = "" |