1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

SCons: Generate header with info on which modules are enabled

We already had `MODULE_*_ENABLED` defines but only in the modules
environment, and a few custom `*_ENABLED` defines in the main env
when we needed the information in core.

Now this is defined in a single header which can be included in the
files that need this information.

(cherry picked from commit b7297fb39c)
This commit is contained in:
Rémi Verschelde
2020-02-06 17:28:32 +01:00
parent aecb1c32ab
commit cbbea6084d
5 changed files with 33 additions and 22 deletions

View File

@@ -238,27 +238,25 @@ def write_modules(modules):
except IOError:
pass
modules_cpp = (
"""
// modules.cpp - THIS FILE IS GENERATED, DO NOT EDIT!!!!!!!
modules_cpp = """// register_module_types.gen.cpp
/* THIS FILE IS GENERATED DO NOT EDIT */
#include "register_module_types.h"
"""
+ includes_cpp
+ """
#include "modules/modules_enabled.gen.h"
%s
void register_module_types() {
"""
+ register_cpp
+ """
%s
}
void unregister_module_types() {
"""
+ unregister_cpp
+ """
%s
}
"""
""" % (
includes_cpp,
register_cpp,
unregister_cpp,
)
# NOTE: It is safe to generate this file here, since this is still executed serially